home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / shells / tcsh6033.zoo / tcsh-603.pl3 / diffs < prev    next >
Text File  |  1993-03-22  |  171KB  |  6,210 lines

  1. diff --context --new-file --recursive ../../store/tcsh-6.03/Makefile ./Makefile
  2. *** ../../store/tcsh-6.03/Makefile    Tue Nov 24 13:04:36 1992
  3. --- ./Makefile    Wed Mar 10 05:54:44 1993
  4. ***************
  5. *** 7,12 ****
  6. --- 7,16 ----
  7.   # With an input editor, command completion, etc. and ported to all sorts of
  8.   # things; Paul Placeway, CIS Dept., Ohio State University
  9.   #
  10. + CROSSDIR = /usr/users1/mat91/mh1/atari/cross-gcc
  11. + CROSSBIN = $(CROSSDIR)/bin
  12.   SHELL=/bin/sh
  13.   VERSION=6.03
  14.   BUILD=tcsh
  15. ***************
  16. *** 24,30 ****
  17.   SUF=o
  18.   CF=-c
  19.   
  20. ! INCLUDES=-I. -I..
  21.   
  22.   LFLAGS=$(INCLUDES)
  23.   #LFLAGS=$(INCLUDES) -Zn10000        # hpux lint
  24. --- 28,35 ----
  25.   SUF=o
  26.   CF=-c
  27.   
  28. ! #INCLUDES=-I. -I..
  29. ! INCLUDES=-I.
  30.   
  31.   LFLAGS=$(INCLUDES)
  32.   #LFLAGS=$(INCLUDES) -Zn10000        # hpux lint
  33. ***************
  34. *** 49,55 ****
  35.   #CFLAGS=-O $(INCLUDES)
  36.   
  37.   # gcc-2.1
  38. ! CFLAGS=-O2 $(INCLUDES)
  39.   
  40.   # gcc 2.1 on linux
  41.   #CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
  42. --- 54,60 ----
  43.   #CFLAGS=-O $(INCLUDES)
  44.   
  45.   # gcc-2.1
  46. ! #CFLAGS=-O2 $(INCLUDES)
  47.   
  48.   # gcc 2.1 on linux
  49.   #CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
  50. ***************
  51. *** 83,88 ****
  52. --- 88,96 ----
  53.   # Dnix 5.3
  54.   #CFLAGS = -O -X7
  55.   
  56. + # MiNT
  57. + CFLAGS = -O6 -fomit-frame-pointer -finline-functions -fstrength-reduce $(INCLUDES)
  58.   # Apollo's with cc [apollo builtins don't work with gcc]
  59.   # and apollo should not define __STDC__ if it does not have
  60.   # the standard header files. RT's (aos4.3) need that too;
  61. ***************
  62. *** 100,106 ****
  63.   #DFLAGS=-D_VMS_POSIX
  64.   # DEC/osf-1 on the alpha
  65.   #DFLAGS=-D_BSD
  66. ! DFLAGS=
  67.   
  68.   
  69.   ################################################################
  70. --- 108,115 ----
  71.   #DFLAGS=-D_VMS_POSIX
  72.   # DEC/osf-1 on the alpha
  73.   #DFLAGS=-D_BSD
  74. ! # MiNT has no crypt()
  75. ! DFLAGS=-DNO_CRYPT -DINBUFSIZE=BUFSIZE
  76.   
  77.   
  78.   ################################################################
  79. ***************
  80. *** 117,123 ****
  81.   ################################################################
  82.   ## LIBES.  Pick one, or roll your own.
  83.   ################################################################
  84. ! LIBES= -ltermcap         ## BSD style things, hpux
  85.   #LIBES= -ltermc            ## emx under OS/2
  86.   #LIBES= -ltermcap -lsec        ## Tek XD88/10 (UTekV) with PW_SHADOW
  87.   #LIBES= -ltermcap -lsec        ## Motorola MPC (sysV88) with PW_SHADOW
  88. --- 126,132 ----
  89.   ################################################################
  90.   ## LIBES.  Pick one, or roll your own.
  91.   ################################################################
  92. ! #LIBES= -ltermcap         ## BSD style things, hpux
  93.   #LIBES= -ltermc            ## emx under OS/2
  94.   #LIBES= -ltermcap -lsec        ## Tek XD88/10 (UTekV) with PW_SHADOW
  95.   #LIBES= -ltermcap -lsec        ## Motorola MPC (sysV88) with PW_SHADOW
  96. ***************
  97. *** 152,159 ****
  98.   #LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
  99.   #LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
  100.   #LIBES= -ltermcap -lauth        ## for Ultrix with Enhanced Security
  101.   
  102.   # The difficult choice of a c-compiler...
  103.   # First, you should try your own c-compiler. 
  104.   # Gcc -traditional is also a safe choice. 
  105. --- 161,168 ----
  106.   #LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
  107.   #LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
  108.   #LIBES= -ltermcap -lauth        ## for Ultrix with Enhanced Security
  109. + LIBES=    -lbtermcap        ## when compiling with -mbaserel in MiNT
  110.   
  111.   # The difficult choice of a c-compiler...
  112.   # First, you should try your own c-compiler. 
  113.   # Gcc -traditional is also a safe choice. 
  114. ***************
  115. *** 164,170 ****
  116.   
  117.   # The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
  118.   # on the suns does not know how to make dynamically linked binaries.
  119. ! CC=    gcc -Wall -B/bin/    
  120.   #CC=    gcc -m486 -Wall # Generate code for Intel 486 (linux)
  121.   #CC=    cc
  122.   #CC=    occ
  123. --- 173,179 ----
  124.   
  125.   # The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
  126.   # on the suns does not know how to make dynamically linked binaries.
  127. ! #CC=    gcc -Wall -B/bin/    
  128.   #CC=    gcc -m486 -Wall # Generate code for Intel 486 (linux)
  129.   #CC=    cc
  130.   #CC=    occ
  131. ***************
  132. *** 173,178 ****
  133. --- 182,190 ----
  134.   #CC=    /bin/cc    # For suns, w/o gcc and SVR4
  135.   #CC=    /usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
  136.   #CC=    scc     # Alliant fx2800
  137. + #CC=    $(CROSSBIN)/cgcc -Wall
  138. + CC=    gcc -mbaserel -Wall # generate shareable code for MiNT
  139.   ED=    ed
  140.   AS=    as
  141.   RM=    rm
  142. diff --context --new-file --recursive ../../store/tcsh-6.03/config.h ./config.h
  143. *** ../../store/tcsh-6.03/config.h
  144. --- ./config.h    Tue Feb 23 21:51:32 1993
  145. ***************
  146. *** 0 ****
  147. --- 1,125 ----
  148. + /*
  149. +  * config.h -- configure various defines for tcsh
  150. +  *
  151. +  * All source files should #include this FIRST.
  152. +  *
  153. +  * Edit this to match your system type.
  154. +  */
  155. + /****************** System dependant compilation flags ****************/
  156. + /*
  157. +  * POSIX    This system supports IEEE Std 1003.1-1988 (POSIX).
  158. +  */
  159. + #undef POSIX
  160. + /*
  161. +  * POSIXJOBS    This system supports the optional IEEE Std 1003.1-1988 (POSIX)
  162. +  *        job control facilities.
  163. +  */
  164. + #undef POSIXJOBS
  165. + /*
  166. +  * POSIXSIGS    Use the POSIX signal facilities to emulate BSD signals.
  167. +  */
  168. + #undef POSIXSIGS
  169. + /*
  170. +  * VFORK    This machine has a vfork().  
  171. +  *        It used to be that for job control to work, this define
  172. +  *        was mandatory. This is not the case any more.
  173. +  *        If you think you still need it, but you don't have vfork, 
  174. +  *        define this anyway and then do #define vfork fork.  
  175. +  *        I do this anyway on a Sun because of yellow pages brain damage,
  176. +  *        [should not be needed under 4.1]
  177. +  *        and on the iris4d cause    SGI's fork is sufficiently "virtual" 
  178. +  *        that vfork isn't necessary.  (Besides, SGI's vfork is weird).
  179. +  *        Note that some machines eg. rs6000 have a vfork, but not
  180. +  *        with the berkeley semantics, so we cannot use it there either.
  181. +  */
  182. + #define VFORK
  183. + /*
  184. +  * BSDJOBS    You have BSD-style job control (both process groups and
  185. +  *        a tty that deals correctly
  186. +  */
  187. + #define BSDJOBS
  188. + /*
  189. +  * BSDSIGS    You have 4.2-style signals, rather than USG style.
  190. +  *        Note: POSIX systems should not define this unless they
  191. +  *        have sigvec() and friends (ie: 4.3BSD-RENO, HP-UX).
  192. +  */
  193. + #define BSDSIGS
  194. + /*
  195. +  * BSDTIMES    You have BSD-style process time stuff (like rusage)
  196. +  *        This may or may not be true.  For example, Apple Unix
  197. +  *        (OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
  198. +  */
  199. + #define BSDTIMES
  200. + /*
  201. +  * BSDLIMIT    You have BSD-style resource limit stuff (getrlimit/setrlimit)
  202. +  */
  203. + #define BSDLIMIT
  204. + /*
  205. +  * BSDNICE    Your system uses setpriority() instead of nice, to
  206. +  *        change a processes scheduling priority
  207. +  */
  208. + #undef BSDNICE
  209. + /*
  210. +  * TERMIO    You have struct termio instead of struct sgttyb.
  211. +  *         This is usually the case for SYSV systems, where
  212. +  *        BSD uses sgttyb. POSIX systems should define this
  213. +  *        anyway, even though they use struct termios.
  214. +  */
  215. + #undef TERMIO
  216. + /*
  217. +  * SYSVREL    Your machine is SYSV based (HPUX, A/UX)
  218. +  *        NOTE: don't do this if you are on a Pyramid -- tcsh is
  219. +  *        built in a BSD universe.
  220. +  *        Set SYSVREL to 1, 2, 3, or 4, depending the version of System V
  221. +  *        you are running. Or set it to 0 if you are not SYSV based
  222. +  */
  223. + #define SYSVREL    0
  224. + /*
  225. +  * YPBUGS    Work around Sun YP bugs that cause expansion of ~username
  226. +  *        to send command output to /dev/null
  227. +  */
  228. + #undef YPBUGS
  229. + /*
  230. +  * SIGVOID    Define this if your signal handlers return void.  On older
  231. +  *        systems, signal returns int, but on newer ones, it returns void.
  232. +  */
  233. + #define SIGVOID 
  234. + /*
  235. +  * HAVEDUP2    Define this if your system supports dup2().
  236. +  */
  237. + #define HAVEDUP2
  238. + /*
  239. +  * UTHOST    Does the utmp file have a host field?
  240. +  */
  241. + #define UTHOST
  242. + /*
  243. +  * DIRENT    Your system has <dirent.h> instead of <sys/dir.h>
  244. +  */
  245. + #define DIRENT
  246. + /****************** local defines *********************/
  247. + #ifndef __MINT__
  248. + # define __MINT__
  249. + #endif
  250. + /****************** configurable hacks ****************/
  251. + /* have been moved to config_f.h */
  252. + #include "config_f.h"
  253. + #undef NLS
  254. diff --context --new-file --recursive ../../store/tcsh-6.03/config_f.h ./config_f.h
  255. *** ../../store/tcsh-6.03/config_f.h    Tue Nov 24 13:04:38 1992
  256. --- ./config_f.h    Thu Mar 11 00:37:34 1993
  257. ***************
  258. *** 56,62 ****
  259.    *        if you don't have <locale.h>, you don't want
  260.    *        to define this.
  261.    */
  262. ! #define NLS
  263.   
  264.   /*
  265.    * LOGINFIRST   Source ~/.login before ~/.cshrc
  266. --- 56,62 ----
  267.    *        if you don't have <locale.h>, you don't want
  268.    *        to define this.
  269.    */
  270. ! #undef NLS
  271.   
  272.   /*
  273.    * LOGINFIRST   Source ~/.login before ~/.cshrc
  274. ***************
  275. *** 90,96 ****
  276.    *        on the name of the tty, and environment.
  277.    *        Does not make sense in the modern window systems!
  278.    */
  279. ! #define AUTOLOGOUT
  280.   
  281.   /*
  282.    * SUSPENDED    Newer shells say 'Suspended' instead of 'Stopped'.
  283. --- 90,96 ----
  284.    *        on the name of the tty, and environment.
  285.    *        Does not make sense in the modern window systems!
  286.    */
  287. ! #undef AUTOLOGOUT
  288.   
  289.   /*
  290.    * SUSPENDED    Newer shells say 'Suspended' instead of 'Stopped'.
  291. ***************
  292. *** 116,121 ****
  293. --- 116,144 ----
  294.   # undef SYSMALLOC
  295.   #endif
  296.   
  297. + #if 1
  298. + # ifndef SYSMALLOC
  299. + #  define SYSMALLOC
  300. + # endif
  301. + #endif
  302. + /*
  303. +  * HASHBANG   Emulate #! interpretation (if both library and kernel don't
  304. +  *            support it)
  305. +  */
  306. + #define HASHBANG
  307. + /*
  308. +  * DOSFS      Support DOS filessystems (which have a 12345678.123 limit),
  309. +  *            and allow backslashes as path separators
  310. +  */
  311. + #define DOSFS
  312. + /*
  313. +  * DOSTEXT    Support DOS text mode/files (ignore 0x0d)
  314. +  */
  315. + #define DOSTEXT
  316.   /*
  317.    * RCSID    This defines if we want rcs strings in the binary or not
  318.    *
  319. diff --context --new-file --recursive ../../store/tcsh-6.03/ed.init.c ./ed.init.c
  320. *** ../../store/tcsh-6.03/ed.init.c    Tue Nov 24 13:04:28 1992
  321. --- ./ed.init.c    Thu Feb 25 04:30:40 1993
  322. ***************
  323. *** 626,631 ****
  324. --- 626,649 ----
  325.       char    buf[BUFSIZE];
  326.   
  327.       chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZE - 1));
  328. + # ifdef DOSTEXT
  329. +         /* strip out carriage returns */
  330. +         if (chrs > 0) {
  331. +                 char *src, *dst;
  332. +                 int i;
  333. +                 src = dst = buf;
  334. +                 for (i = chrs; i > 0; --i) {
  335. +                         if (*src == '\r')
  336. +                                 --chrs;
  337. +                         else
  338. +                                 *dst++ = *src;
  339. +                         src++;
  340. +                 }
  341. +         }
  342. + # endif
  343.       if (chrs > 0) {
  344.           buf[chrs] = '\0';
  345.           Input_Line = Strsave(str2short(buf));
  346. diff --context --new-file --recursive ../../store/tcsh-6.03/ed.inputl.c ./ed.inputl.c
  347. *** ../../store/tcsh-6.03/ed.inputl.c    Tue Nov 24 13:04:30 1992
  348. --- ./ed.inputl.c    Thu Feb 25 04:33:52 1993
  349. ***************
  350. *** 99,105 ****
  351.       if (!Tty_raw_mode && MacroLvl < 0) {
  352.       long    chrs = 0;
  353.   
  354. !     (void) ioctl(SHIN, FIONREAD, (ioctl_t) & chrs);
  355.       if (chrs == 0) {
  356.           if (Rawmode() < 0)
  357.           return 0;
  358. --- 99,111 ----
  359.       if (!Tty_raw_mode && MacroLvl < 0) {
  360.       long    chrs = 0;
  361.   
  362. ! # ifndef __MINT__
  363. ! /* MiNT _always_ wants to go into raw mode, so don't bother with the
  364. !  * FIONREAD test
  365. !  */
  366. !         (void) ioctl(SHIN, FIONREAD, (ioctl_t) & chrs);
  367. ! # endif
  368.       if (chrs == 0) {
  369.           if (Rawmode() < 0)
  370.           return 0;
  371. diff --context --new-file --recursive ../../store/tcsh-6.03/pathnames.h ./pathnames.h
  372. *** ../../store/tcsh-6.03/pathnames.h    Tue Nov 24 13:04:38 1992
  373. --- ./pathnames.h    Thu Feb 25 04:36:08 1993
  374. ***************
  375. *** 69,74 ****
  376. --- 69,80 ----
  377.   # endif /* !_PATH_DOTCSHRC */
  378.   #endif /* NeXT */
  379.   
  380. + #ifdef DOSFS
  381. + # define _PATH_DOTLOGIN         "/etc/login.csh"
  382. + # define _PATH_DOTLOGOUT        "/etc/logout.csh"
  383. + # define _PATH_DOTCSHRC         "/etc/cshrc.csh"
  384. + #endif
  385.   #if defined(sgi) || defined(OREO) || defined(cray) || defined(AMIX) || defined(CDC)
  386.   # ifndef _PATH_DOTLOGIN
  387.   #  define _PATH_DOTLOGIN    "/etc/cshrc"
  388. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.c ./sh.c
  389. *** ../../store/tcsh-6.03/sh.c    Tue Nov 24 13:04:16 1992
  390. --- ./sh.c    Sun Mar  7 17:43:04 1993
  391. ***************
  392. *** 118,123 ****
  393. --- 118,128 ----
  394.   static    void          mailchk    __P((void));
  395.   static    Char         **defaultpath    __P((void));
  396.   
  397. + #ifdef __MINT__
  398. + static  Char            **defaultsuffixes __P((void));
  399. + void    importsuffixes  __P((Char *));
  400. + #endif
  401.   int
  402.   main(argc, argv)
  403.       int     argc;
  404. ***************
  405. *** 229,234 ****
  406. --- 234,249 ----
  407.       loginsh = (argc == 1 && getppid() == 1);
  408.   #endif /* _VMS_POSIX */
  409.   
  410. + #ifdef __MINT__
  411. +     /* under MiNT, we're also a login shell if we ran from the desktop and
  412. +      * have no arguments
  413. +      */
  414. +     if (!loginsh && tempv[0][0] == 0 && !tempv[1]) {
  415. +         loginsh = 1;
  416. +         tempv[0] = "-tcsh";
  417. +     }
  418. + #endif
  419.       if (loginsh && **tempv != '-') {
  420.       /*
  421.        * Mangle the argv space
  422. ***************
  423. *** 373,379 ****
  424.       if (loginsh || (uid == 0)) {
  425.       if (*cp) {
  426.           /* only for login shells or root and we must have a tty */
  427. !         if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
  428.           cp = cp2 + 1;
  429.           }
  430.           if (!((Strncmp(cp, STRtty, 3) == 0) &&
  431. --- 388,394 ----
  432.       if (loginsh || (uid == 0)) {
  433.       if (*cp) {
  434.           /* only for login shells or root and we must have a tty */
  435. !         if ((cp2 = Lastslash(cp)) != NULL) {
  436.           cp = cp2 + 1;
  437.           }
  438.           if (!((Strncmp(cp, STRtty, 3) == 0) &&
  439. ***************
  440. *** 535,540 ****
  441. --- 550,564 ----
  442.        */
  443.       importpath(str2short(tcp));
  444.   
  445. + #ifdef __MINT__
  446. +     /*
  447. +      * set the suffix search list
  448. +      */
  449. +     if ((tcp = getenv("SUFFIXES")) == NULL)
  450. +         set1(STRsuffixes, defaultsuffixes(), &shvhed);
  451. +     else
  452. +         importsuffixes(SAVE(tcp));
  453. + #endif
  454.   
  455.       {
  456.       /* If the SHELL environment variable ends with "tcsh", set
  457. ***************
  458. *** 769,774 ****
  459. --- 793,808 ----
  460.        */
  461.       if (nofile == 0 && argc > 0) {
  462.       nofile = open(tempv[0], O_RDONLY);
  463. + #ifdef __MINT__
  464. +         /* maybe the user tried to execute "foo.csh" as just "foo"
  465. +          */
  466. +         if (nofile < 0) {
  467. +             char *cshfile = alloca(strlen(tempv[0]) + 5);
  468. +             strcpy(cshfile, tempv[0]);
  469. +             strcat(cshfile, ".csh");
  470. +             nofile = open(cshfile, O_RDONLY);
  471. +         }
  472. + #endif
  473.       if (nofile < 0) {
  474.           child = 1;        /* So this ... */
  475.           /* ... doesn't return */
  476. ***************
  477. *** 1165,1171 ****
  478.   srccat(cp, dp)
  479.       Char   *cp, *dp;
  480.   {
  481. !     if (cp[0] == '/' && cp[1] == '\0') 
  482.       return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
  483.       else {
  484.       register Char *ep = Strspl(cp, dp);
  485. --- 1199,1205 ----
  486.   srccat(cp, dp)
  487.       Char   *cp, *dp;
  488.   {
  489. !     if (is_dirsep(cp[0]) && cp[1] == '\0') 
  490.       return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
  491.       else {
  492.       register Char *ep = Strspl(cp, dp);
  493. ***************
  494. *** 1952,1957 ****
  495. --- 1986,1995 ----
  496.   #endif
  497.       int     i;
  498.   {
  499. + #ifdef __MINT__
  500. +     void rm_tmpfiles();
  501. +     rm_tmpfiles();                      /* remove temporary files, see below */
  502. + #endif
  503.   #ifdef TESLA
  504.       if (loginsh && do_logout) {
  505.       /* this is to send hangup signal to the develcon */
  506. ***************
  507. *** 2018,2020 ****
  508. --- 2056,2196 ----
  509.       *blkp = NULL;
  510.       return (blk);
  511.   }
  512. + #ifdef __MINT__
  513. + /*
  514. +  * unlink() doesn't always work on an open file, so we try to arrange
  515. +  * to remove temporary files (e.g. for here documents) before exiting.
  516. +  */
  517. + struct tmpfile_rec {
  518. +         char *name;     /* the name of the temp. file */
  519. +         int pid;        /* the associated pid */
  520. +         struct tmpfile_rec *next;
  521. + } *root;
  522. + extern int __mint;
  523. + int
  524. + csh_tmpfile()
  525. + {
  526. +         extern char *tmpnam();
  527. +         struct tmpfile_rec *u;
  528. +         int fd;
  529. +         char *name;
  530. +         if ( !(name = tmpnam((char *)0)) )
  531. +                 return -1;
  532. +         fd = open(name, O_CREAT|O_EXCL|O_RDWR, 0600);
  533. +         if (fd < 0) {
  534. +                 free(name);
  535. +                 return -1;
  536. +         }
  537. + /* in MiNT 0.9 and above, we can often unlink a file and continue to use
  538. +  * it; some file systems may return EACCDN for unlinking an open file,
  539. +  * in which case we use the old method of unlinking the file at exit
  540. +  */
  541. +         if (__mint >= 9) {
  542. +                 if (unlink(name) == 0)
  543. +                         return fd;
  544. +         }
  545. + /* if the unlink failed, save the name for future deleting */
  546. +         u = (struct tmpfile_rec *)malloc(sizeof(*u));
  547. +         if (!u) {
  548. + /* would it be better to fail? I dunno, but at worst the user is left
  549. +  * with a junk file in a temporary directory
  550. +  */
  551. +                 return fd;
  552. +         }
  553. +         u->name = name;
  554. +         u->pid = getpid();
  555. +         u->next = root;
  556. +         root = u;
  557. +         return fd;
  558. + }
  559. + void
  560. + rm_tmpfiles()
  561. + {
  562. +         int pid = getpid();
  563. +         struct tmpfile_rec **old, *u;
  564. +         old = &root;
  565. +         u = root;
  566. +         while (u) {
  567. +                 if (u->pid == pid) {
  568. +                         (void) unlink(u->name);
  569. +                         *old = u->next;
  570. +                 } else {
  571. +                         old = &u->next;
  572. +                 }
  573. +                 u = u->next;
  574. +         }
  575. + }
  576. + /* MiNT suffix stuff
  577. +  */
  578. + void
  579. + importsuffixes(cp)
  580. +     Char   *cp;
  581. + {
  582. +     register int i = 0;
  583. +     register Char *dp;
  584. +     register Char **pv;
  585. +     int     c;
  586. +     for (dp = cp; *dp; dp++)
  587. +         if (*dp == ',')
  588. +             i++;
  589. +     /*
  590. +      * i+2 where i is the number of ',' in the suffix list. There are i+1
  591. +      * suffixes plus we need room for a zero terminator.
  592. +      */
  593. +     pv = (Char **) xcalloc((size_t) (i + 2), sizeof(Char *));
  594. +     dp = cp;
  595. +     i = 0;
  596. +     if (*dp)
  597. +         for (;;) {
  598. +             if ((c = *dp) == ',' || c == 0) {
  599. +                 *dp = 0;
  600. +                 pv[i++] = Strsave(cp);
  601. +                 if (c) {
  602. +                     cp = dp + 1;
  603. +                     *dp = ',';
  604. +                 }
  605. +                 else
  606. +                     break;
  607. +             }
  608. +             dp++;
  609. +         }
  610. +     pv[i] = 0;
  611. +     set1(STRsuffixes, pv, &shvhed);
  612. + }
  613. + static Char **
  614. + defaultsuffixes()
  615. + {
  616. +     Char  **blk, **blkp;
  617. +     blkp = blk = (Char **) xmalloc((size_t) sizeof(Char *) * 9);
  618. +     *blkp++ = SAVE("ttp");
  619. +     *blkp++ = SAVE("prg");
  620. +     *blkp++ = SAVE("tos");
  621. +     *blkp++ = SAVE("app");
  622. +     *blkp++ = SAVE("gtp");
  623. +     *blkp++ = SAVE("csh");
  624. +     *blkp++ = SAVE("");
  625. +     *blkp = NULL;
  626. +     return (blk);
  627. + }
  628. + #endif /* __MINT__ */
  629. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.char.c ./sh.char.c
  630. *** ../../store/tcsh-6.03/sh.char.c    Tue Nov 24 13:04:18 1992
  631. --- ./sh.char.c    Thu Feb 25 04:57:24 1993
  632. ***************
  633. *** 51,58 ****
  634.       _CTR,        _CTR|_SP|_META,    _CTR|_NL|_META,    _CTR,
  635.   
  636.   /*     12 np         13 cr         14 so         15 si    */
  637. !     _CTR,        _CTR,        _CTR,        _CTR,
  638.   /*     16 dle         17 dc1         18 dc2         19 dc3    */
  639.       _CTR,        _CTR,        _CTR,        _CTR,
  640.   
  641. --- 51,62 ----
  642.       _CTR,        _CTR|_SP|_META,    _CTR|_NL|_META,    _CTR,
  643.   
  644.   /*     12 np         13 cr         14 so         15 si    */
  645. ! #ifndef DOSTEXT
  646. !         _CTR,           _CTR,           _CTR,           _CTR,
  647. ! #else
  648. ! /* cr is whitespace */
  649. !         _CTR,           _CTR|_SP|_META, _CTR,           _CTR,
  650. ! #endif
  651.   /*     16 dle         17 dc1         18 dc2         19 dc3    */
  652.       _CTR,        _CTR,        _CTR,        _CTR,
  653.   
  654. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.dir.c ./sh.dir.c
  655. *** ../../store/tcsh-6.03/sh.dir.c    Tue Nov 24 13:04:18 1992
  656. --- ./sh.dir.c    Sun Mar  7 18:46:50 1993
  657. ***************
  658. *** 242,248 ****
  659.       len = Strlen(hp);
  660.       if (!(dflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
  661.           Strncmp(hp, dp->di_name, len) == 0 &&
  662. !         (dp->di_name[len] == '\0' || dp->di_name[len] == '/')) 
  663.           len = Strlen(s = (dp->di_name + len)) + 2;
  664.       else
  665.           len = Strlen(s = dp->di_name) + 1;
  666. --- 242,248 ----
  667.       len = Strlen(hp);
  668.       if (!(dflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
  669.           Strncmp(hp, dp->di_name, len) == 0 &&
  670. !         (dp->di_name[len] == '\0' || is_dirsep(dp->di_name[len])))
  671.           len = Strlen(s = (dp->di_name + len)) + 2;
  672.       else
  673.           len = Strlen(s = dp->di_name) + 1;
  674. ***************
  675. *** 301,308 ****
  676.   {
  677.   
  678.   /* return true if dp is of the form "../xxx" or "/../xxx" */
  679. ! #define IS_DOTDOT(sp, p) (ISDOTDOT(p) && ((p) == (sp) || *((p) - 1) == '/'))
  680. ! #define IS_DOT(sp, p) (ISDOT(p) && ((p) == (sp) || *((p) - 1) == '/'))
  681.   
  682.   #ifdef S_IFLNK
  683.       if (exp) {
  684. --- 301,308 ----
  685.   {
  686.   
  687.   /* return true if dp is of the form "../xxx" or "/../xxx" */
  688. ! #define IS_DOTDOT(sp, p) (ISDOTDOT(p) && ((p) == (sp) || is_dirsep(*((p) - 1))))
  689. ! #define IS_DOT(sp, p) (ISDOT(p) && ((p) == (sp) || is_dirsep(*((p) - 1))))
  690.   
  691.   #ifdef S_IFLNK
  692.       if (exp) {
  693. ***************
  694. *** 332,338 ****
  695.        * If the path starts with a slash, we are not relative to
  696.        * the current working directory.
  697.        */
  698. !     if ( *start == '/' )
  699.           *cwd = '\0';
  700.   # ifdef apollo
  701.       slashslash = cwd[0] == '/' && cwd[1] == '/';
  702. --- 332,338 ----
  703.        * If the path starts with a slash, we are not relative to
  704.        * the current working directory.
  705.        */
  706. !     if ( is_abspath(start) )
  707.           *cwd = '\0';
  708.   # ifdef apollo
  709.       slashslash = cwd[0] == '/' && cwd[1] == '/';
  710. ***************
  711. *** 363,369 ****
  712.   
  713.           *dp = '\0';
  714.           while (dotdot > 0) 
  715. !             if ((dp = Strrchr(cwd, '/')) != NULL) {
  716.   # ifdef apollo
  717.               if (dp == &cwd[1]) 
  718.                   slashslash = 1;
  719. --- 363,369 ----
  720.   
  721.           *dp = '\0';
  722.           while (dotdot > 0) 
  723. !             if ((dp = Lastslash(cwd)) != NULL) {
  724.   # ifdef apollo
  725.               if (dp == &cwd[1]) 
  726.                   slashslash = 1;
  727. ***************
  728. *** 391,403 ****
  729.   # endif /* apollo */
  730.   
  731.           if (buf[0]) {
  732. !             if ((TRM(cwd[(dotdot = Strlen(cwd)) - 1])) != '/')
  733.               cwd[dotdot++] = '/';
  734.               cwd[dotdot] = '\0';
  735. !             dp = Strspl(cwd, TRM(buf[0]) == '/' ? &buf[1] : buf);
  736.               xfree((ptr_t) cwd);
  737.               cwd = dp;
  738. !             if ((TRM(cwd[(dotdot = Strlen(cwd)) - 1])) == '/')
  739.               cwd[--dotdot] = '\0';
  740.           }
  741.           if (!*cp)
  742. --- 391,403 ----
  743.   # endif /* apollo */
  744.   
  745.           if (buf[0]) {
  746. !             if (! is_dirsep(TRM(cwd[(dotdot = Strlen(cwd)) - 1])))
  747.               cwd[dotdot++] = '/';
  748.               cwd[dotdot] = '\0';
  749. !             dp = Strspl(cwd, is_dirsep(TRM(buf[0])) ? &buf[1] : buf);
  750.               xfree((ptr_t) cwd);
  751.               cwd = dp;
  752. !             if (is_dirsep(TRM(cwd[(dotdot = Strlen(cwd)) - 1])))
  753.               cwd[--dotdot] = '\0';
  754.           }
  755.           if (!*cp)
  756. ***************
  757. *** 470,476 ****
  758.   {
  759.       Char   *dp;
  760.   
  761. !     if (*cp != '/') {
  762.       register Char *p, *q;
  763.       int     cwdlen;
  764.   
  765. --- 470,476 ----
  766.   {
  767.       Char   *dp;
  768.   
  769. !     if (! is_abspath(cp)) {
  770.       register Char *p, *q;
  771.       int     cwdlen;
  772.   
  773. ***************
  774. *** 547,553 ****
  775.       serrno = errno;
  776.       }
  777.   
  778. !     if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
  779.       && (c = adrof(STRcdpath))) {
  780.       Char  **cdp;
  781.       register Char *p;
  782. --- 547,553 ----
  783.       serrno = errno;
  784.       }
  785.   
  786. !     if (!is_abspath(cp) && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
  787.       && (c = adrof(STRcdpath))) {
  788.       Char  **cdp;
  789.       register Char *p;
  790. ***************
  791. *** 578,584 ****
  792.       }
  793.       }
  794.       dp = value(cp);
  795. !     if ((dp[0] == '/' || dp[0] == '.') && chdir(short2str(dp)) >= 0) {
  796.       xfree((ptr_t) cp);
  797.       cp = Strsave(dp);
  798.       printd = 1;
  799. --- 578,584 ----
  800.       }
  801.       }
  802.       dp = value(cp);
  803. !     if ((is_abspath(dp) || dp[0] == '.') && chdir(short2str(dp)) >= 0) {
  804.       xfree((ptr_t) cp);
  805.       cp = Strsave(dp);
  806.       printd = 1;
  807. ***************
  808. *** 801,811 ****
  809.        * christos: if the path given does not start with a slash prepend cwd. If
  810.        * cwd does not start with a slash or the result would be too long abort().
  811.        */
  812. !     if (*cp != '/') {
  813.       Char    tmpdir[MAXPATHLEN];
  814.   
  815.       p1 = value(STRcwd);
  816. !     if (p1 == STRNULL || *p1 != '/')
  817.           abort();
  818.       if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN)
  819.           abort();
  820. --- 801,811 ----
  821.        * christos: if the path given does not start with a slash prepend cwd. If
  822.        * cwd does not start with a slash or the result would be too long abort().
  823.        */
  824. !     if (! is_abspath(cp)) {
  825.       Char    tmpdir[MAXPATHLEN];
  826.   
  827.       p1 = value(STRcwd);
  828. !     if (p1 == STRNULL || !is_abspath(p1))
  829.           abort();
  830.       if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN)
  831.           abort();
  832. ***************
  833. *** 817,823 ****
  834.       }
  835.   
  836.   #ifdef COMMENT
  837. !     if (*cp != '/')
  838.       abort();
  839.   #endif /* COMMENT */
  840.   
  841. --- 817,823 ----
  842.       }
  843.   
  844.   #ifdef COMMENT
  845. !     if (!is_abspath(cp))
  846.       abort();
  847.   #endif /* COMMENT */
  848.   
  849. ***************
  850. *** 827,833 ****
  851.   
  852.       while (*p) {        /* for each component */
  853.       sp = p;            /* save slash address */
  854. !     while (*++p == '/')    /* flush extra slashes */
  855.           continue;
  856.       if (p != ++sp)
  857.           for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
  858. --- 827,833 ----
  859.   
  860.       while (*p) {        /* for each component */
  861.       sp = p;            /* save slash address */
  862. !     while (is_dirsep(*++p))    /* flush extra slashes */
  863.           continue;
  864.       if (p != ++sp)
  865.           for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
  866. ***************
  867. *** 835,841 ****
  868.       p = sp;            /* save start of component */
  869.       slash = 0;
  870.       while (*++p)        /* find next slash or end of path */
  871. !         if (*p == '/') {
  872.           slash = 1;
  873.           *p = 0;
  874.           break;
  875. --- 835,841 ----
  876.       p = sp;            /* save start of component */
  877.       slash = 0;
  878.       while (*++p)        /* find next slash or end of path */
  879. !         if (is_dirsep(*p)) {
  880.           slash = 1;
  881.           *p = 0;
  882.           break;
  883. ***************
  884. *** 885,896 ****
  885.            */
  886.           for (p1 = p; *p1++;)
  887.               continue;
  888. !         if (*link != '/') {
  889.               /*
  890.                * Relative path, expand it between the "yyy/" and the
  891.                * "/..". First, back sp up to the character past "yyy/".
  892.                */
  893. !             while (*--sp != '/')
  894.               continue;
  895.               sp++;
  896.               *sp = 0;
  897. --- 885,896 ----
  898.            */
  899.           for (p1 = p; *p1++;)
  900.               continue;
  901. !         if (! is_abspath(link)) {
  902.               /*
  903.                * Relative path, expand it between the "yyy/" and the
  904.                * "/..". First, back sp up to the character past "yyy/".
  905.                */
  906. !             while (!is_dirsep(*--sp))
  907.               continue;
  908.               sp++;
  909.               *sp = 0;
  910. ***************
  911. *** 942,948 ****
  912.   #endif /* S_IFLNK */
  913.           *sp = '/';
  914.           if (sp != cp)
  915. !         while (*--sp != '/')
  916.               continue;
  917.           if (slash) {
  918.           for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
  919. --- 942,948 ----
  920.   #endif /* S_IFLNK */
  921.           *sp = '/';
  922.           if (sp != cp)
  923. !         while (!is_dirsep(*--sp))
  924.               continue;
  925.           if (slash) {
  926.           for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
  927. ***************
  928. *** 979,991 ****
  929.            */
  930.           for (p1 = p; *p1++;)
  931.               continue;
  932. !         if (*link != '/') {
  933.               /*
  934.                * Relative path, expand it between the "yyy/" and the
  935.                * remainder. First, back sp up to the character past
  936.                * "yyy/".
  937.                */
  938. !             while (*--sp != '/')
  939.               continue;
  940.               sp++;
  941.               *sp = 0;
  942. --- 979,991 ----
  943.            */
  944.           for (p1 = p; *p1++;)
  945.               continue;
  946. !         if (! is_abspath(link)) {
  947.               /*
  948.                * Relative path, expand it between the "yyy/" and the
  949.                * remainder. First, back sp up to the character past
  950.                * "yyy/".
  951.                */
  952. !             while (! is_dirsep(*--sp))
  953.               continue;
  954.               sp++;
  955.               *sp = 0;
  956. ***************
  957. *** 1049,1056 ****
  958.       /*
  959.        * See if we're not in a subdir of STRhome
  960.        */
  961. !     if (p1 && *p1 == '/' &&
  962. !     (Strncmp(p1, cp, cc) != 0 || (cp[cc] != '/' && cp[cc] != '\0'))) {
  963.       static ino_t home_ino = (ino_t) -1;
  964.       static dev_t home_dev = -1;
  965.       static Char *home_ptr = NULL;
  966. --- 1049,1056 ----
  967.       /*
  968.        * See if we're not in a subdir of STRhome
  969.        */
  970. !     if (p1 && is_abspath(p1) &&
  971. !     (Strncmp(p1, cp, cc) != 0 || (!is_dirsep(cp[cc]) && cp[cc] != '\0'))) {
  972.       static ino_t home_ino = (ino_t) -1;
  973.       static dev_t home_dev = -1;
  974.       static Char *home_ptr = NULL;
  975. ***************
  976. *** 1075,1081 ****
  977.               sp = (Char *) - 1;
  978.               break;
  979.           }
  980. !         if ((sp = Strrchr(p2, '/')) != NULL)
  981.           *sp = '\0';
  982.       }
  983.       /*
  984. --- 1075,1081 ----
  985.               sp = (Char *) - 1;
  986.               break;
  987.           }
  988. !         if ((sp = Lastslash(p2)) != NULL)
  989.           *sp = '\0';
  990.       }
  991.       /*
  992. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.dol.c ./sh.dol.c
  993. *** ../../store/tcsh-6.03/sh.dol.c    Tue Nov 24 13:04:18 1992
  994. --- ./sh.dol.c    Thu Feb 25 05:37:04 1993
  995. ***************
  996. *** 480,485 ****
  997. --- 480,491 ----
  998.       if (length)
  999.           stderror(ERR_NOTALLOWED, "$%<");
  1000.       for (np = wbuf; read(OLDSTD, &tnp, 1) == 1; np++) {
  1001. + #ifdef DOSTEXT
  1002. +             /* strip out cr's */
  1003. +             while (tnp == '\r') {
  1004. +                 if (read(OLDSTD, &tnp, 1) != 1) break;
  1005. +             }
  1006. + #endif
  1007.           *np = (unsigned char) tnp;
  1008.           if (np >= &wbuf[BUFSIZE - 1])
  1009.           stderror(ERR_LTOOLONG);
  1010. ***************
  1011. *** 940,945 ****
  1012. --- 946,961 ----
  1013.       register Char *lbp, *obp, *mbp;
  1014.       Char  **vp;
  1015.       bool    quoted;
  1016. + #ifdef __MINT__
  1017. +     int tf;
  1018. +     extern int csh_tmpfile __P((void));   /* in sh.c */
  1019. +     tf = csh_tmpfile();
  1020. +     if (tf < 0)
  1021. +         stderror(ERR_SYSTEM, "tmpfile", strerror(errno));
  1022. +     (void)dup2(tf, 0);
  1023. +     (void)close(tf);
  1024. + #else
  1025.       char   *tmp;
  1026.   
  1027.       if (creat(tmp = short2str(shtemp), 0600) < 0)
  1028. ***************
  1029. *** 953,958 ****
  1030. --- 969,976 ----
  1031.       stderror(ERR_SYSTEM, tmp, strerror(errno));
  1032.       }
  1033.       (void) unlink(tmp);        /* 0 0 inode! */
  1034. + #endif /* __MINT__ */
  1035.       Dv[0] = term;
  1036.       Dv[1] = NULL;
  1037.       gflag = 0;
  1038. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.exec.c ./sh.exec.c
  1039. *** ../../store/tcsh-6.03/sh.exec.c    Tue Nov 24 13:04:18 1992
  1040. --- ./sh.exec.c    Wed Mar 10 08:54:36 1993
  1041. ***************
  1042. *** 49,54 ****
  1043. --- 49,60 ----
  1044.   # define FASTHASH    /* Fast hashing is the default */
  1045.   #endif /* OLDHASH */
  1046.   
  1047. + #ifdef __MINT__
  1048. + extern char **environ;
  1049. + int     csh_execve      __P((char *, char **, char **));
  1050. + #define execv(f, t) csh_execve(f, t, environ)
  1051. + #endif
  1052.   /*
  1053.    * System level search and execute of a command.
  1054.    * We look in each directory for the specified command name.
  1055. ***************
  1056. *** 180,190 ****
  1057.   #endif /* VFORK */
  1058.   
  1059.       v = adrof(STRpath);
  1060. !     if (v == 0 && expath[0] != '/') {
  1061.       blkfree(pv);
  1062.       pexerr();
  1063.       }
  1064. !     slash = any(short2str(expath), '/');
  1065.   
  1066.       /*
  1067.        * Glob the argument list, if necessary. Otherwise trim off the quote bits.
  1068. --- 186,196 ----
  1069.   #endif /* VFORK */
  1070.   
  1071.       v = adrof(STRpath);
  1072. !     if (v == 0 && !is_abspath(expath)) {
  1073.       blkfree(pv);
  1074.       pexerr();
  1075.       }
  1076. !     slash = has_slash(short2str(expath));
  1077.   
  1078.       /*
  1079.        * Glob the argument list, if necessary. Otherwise trim off the quote bits.
  1080. ***************
  1081. *** 266,272 ****
  1082.        * one at a time, as the user enters them.  This is kinda like Korn
  1083.        * Shell's "tracked aliases".
  1084.        */
  1085. !     if (!slash && pv[0][0] == '/' && havhash) {
  1086.   #ifdef FASTHASH
  1087.           if (!bit(hashval, i))
  1088.           goto cont;
  1089. --- 272,278 ----
  1090.        * one at a time, as the user enters them.  This is kinda like Korn
  1091.        * Shell's "tracked aliases".
  1092.        */
  1093. !     if (!slash && is_abspath(pv[0]) && havhash) {
  1094.   #ifdef FASTHASH
  1095.           if (!bit(hashval, i))
  1096.           goto cont;
  1097. ***************
  1098. *** 421,427 ****
  1099. --- 427,438 ----
  1100.        */
  1101.       if ((fd = open(f, O_RDONLY)) != -1) {
  1102.           if (read(fd, (char *) pref, 2) == 2) {
  1103. + #ifndef DOSTEXT
  1104.           if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t')) {
  1105. + #else
  1106. +         if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t'
  1107. +                                   && pref[0] != '\r')) {
  1108. + #endif
  1109.               (void) close(fd);
  1110.               /*
  1111.                * We *know* what ENOEXEC means.
  1112. ***************
  1113. *** 637,642 ****
  1114. --- 648,657 ----
  1115.       struct varent *v = adrof(STRpath);
  1116.       Char  **pv;
  1117.       int hashval;
  1118. + #ifdef __MINT__
  1119. +     struct varent *suffv = adrof(STRsuffixes);
  1120. +     Char **suffpv;
  1121. + #endif
  1122.   
  1123.   #ifdef FASTHASH
  1124.       if (vv && vv[1]) {
  1125. ***************
  1126. *** 677,683 ****
  1127.       if (v == NULL)
  1128.       return;
  1129.       for (pv = v->vec; *pv; pv++, i++) {
  1130. !     if (pv[0][0] != '/')
  1131.           continue;
  1132.       dirp = opendir(short2str(*pv));
  1133.       if (dirp == NULL)
  1134. --- 692,698 ----
  1135.       if (v == NULL)
  1136.       return;
  1137.       for (pv = v->vec; *pv; pv++, i++) {
  1138. !     if (! is_abspath(pv[0]))
  1139.           continue;
  1140.       dirp = opendir(short2str(*pv));
  1141.       if (dirp == NULL)
  1142. ***************
  1143. *** 696,701 ****
  1144. --- 711,729 ----
  1145.           (dp->d_name[1] == '\0' ||
  1146.            (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
  1147.           continue;
  1148. + #ifdef __MINT__
  1149. +             {   char *s = rindex(dp->d_name, '.');
  1150. +                 if (s && suffv) {
  1151. +                     for (suffpv = suffv->vec; *suffpv; suffpv++) {
  1152. +                         if (!strcmp(s+1, short2str(*suffpv))) {
  1153. +                             *s = 0; break;
  1154. +                         }
  1155. +                     }
  1156. +                 }
  1157. +             }
  1158. + #endif /* __MINT__ */
  1159.   #ifdef FASTHASH
  1160.           hashval = hashname(str2short(dp->d_name));
  1161.           bis(hashval, i);
  1162. ***************
  1163. *** 769,775 ****
  1164.       register Char **pv;
  1165.       register Char *sav;
  1166.       register struct varent *v;
  1167. !     register bool slash = any(short2str(name), '/');
  1168.       register int hashval, i;
  1169.   
  1170.       v = adrof(STRpath);
  1171. --- 797,803 ----
  1172.       register Char **pv;
  1173.       register Char *sav;
  1174.       register struct varent *v;
  1175. !     register bool slash = has_slash(short2str(name));
  1176.       register int hashval, i;
  1177.   
  1178.       v = adrof(STRpath);
  1179. ***************
  1180. *** 781,787 ****
  1181.       hashval = havhash ? hashname(name) : 0;
  1182.       i = 0;
  1183.       do {
  1184. !     if (!slash && pv[0][0] == '/' && havhash) {
  1185.   #ifdef FASTHASH
  1186.           if (!bit(hashval, i))
  1187.           goto cont;
  1188. --- 809,815 ----
  1189.       hashval = havhash ? hashname(name) : 0;
  1190.       i = 0;
  1191.       do {
  1192. !     if (!slash && is_abspath(pv[0]) && havhash) {
  1193.   #ifdef FASTHASH
  1194.           if (!bit(hashval, i))
  1195.           goto cont;
  1196. ***************
  1197. *** 827,832 ****
  1198. --- 855,912 ----
  1199.    * if dir_ok is set and the pathname refers to a directory.
  1200.    * This is a bit kludgy, but in the name of optimization...
  1201.    */
  1202. + #ifdef __MINT__
  1203. + int
  1204. + executable(dir, name, dir_ok)
  1205. +     Char   *dir, *name;
  1206. +     bool    dir_ok;
  1207. + {
  1208. +     char *ext, *base;
  1209. +     struct stat stbuf;
  1210. +     Char    path[MAXPATHLEN + 1];
  1211. +     char   *strname;
  1212. +     struct varent *v;
  1213. +     Char **pv;
  1214. +     if (dir && *dir) {
  1215. +         copyn(path, dir, MAXPATHLEN);
  1216. +         catn(path, name, MAXPATHLEN);
  1217. +         strname = short2str(path);
  1218. +     }
  1219. +     else
  1220. +         strname = short2str(name);
  1221. +     ext = base = alloca(strlen(strname) + 5);
  1222. +     while (*strname)
  1223. +         *ext++ = *strname++;
  1224. +     *ext = 0;
  1225. +     if (stat(base, &stbuf) != -1 &&
  1226. +         ((dir_ok && S_ISDIR(stbuf.st_mode)) ||
  1227. +           (S_ISREG(stbuf.st_mode) &&
  1228. +           ((stbuf.st_mode & (S_IXOTH|S_IXGRP|S_IXUSR))))))
  1229. +                 return 1;
  1230. +     if (dir_ok) return 0;
  1231. +     v = adrof(STRsuffixes);
  1232. +     if (v == 0) return 0;
  1233. +     *ext++ = '.';
  1234. +     for (pv = v->vec; *pv; pv++) {
  1235. +         strcpy(ext, short2str(*pv));
  1236. +         if (stat(base, &stbuf) != -1 &&
  1237. +             (S_ISREG(stbuf.st_mode) &&
  1238. +              ((stbuf.st_mode & (S_IXOTH|S_IXGRP|S_IXUSR)) ||
  1239. +               !strcmp(ext, "csh"))))
  1240. +                return 1;
  1241. +     }
  1242. +     return 0;
  1243. + }
  1244. + #else /* __MINT__ */
  1245.   int
  1246.   executable(dir, name, dir_ok)
  1247.       Char   *dir, *name;
  1248. ***************
  1249. *** 851,856 ****
  1250. --- 931,937 ----
  1251.             (stbuf.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)) &&
  1252.             access(strname, X_OK) == 0)));
  1253.   }
  1254. + #endif /* __MINT__ */
  1255.   
  1256.   void
  1257.   tellmewhat(lex)
  1258. ***************
  1259. *** 910,916 ****
  1260.       if ((i = iscommand(strip(sp->word))) != 0) {
  1261.       register Char **pv;
  1262.       register struct varent *v;
  1263. !     bool    slash = any(short2str(sp->word), '/');
  1264.   
  1265.       v = adrof(STRpath);
  1266.       if (v == 0 || v->vec[0] == 0 || slash)
  1267. --- 991,997 ----
  1268.       if ((i = iscommand(strip(sp->word))) != 0) {
  1269.       register Char **pv;
  1270.       register struct varent *v;
  1271. !     bool    slash = has_slash(short2str(sp->word));
  1272.   
  1273.       v = adrof(STRpath);
  1274.       if (v == 0 || v->vec[0] == 0 || slash)
  1275. ***************
  1276. *** 975,981 ****
  1277.       Char *sv;
  1278.       int hashval, i, ex, rval = 0;
  1279.   
  1280. !     if (prt && any(short2str(cmd), '/')) {
  1281.       xprintf("where: / in command makes no sense\n");
  1282.       return 0;
  1283.       }
  1284. --- 1056,1062 ----
  1285.       Char *sv;
  1286.       int hashval, i, ex, rval = 0;
  1287.   
  1288. !     if (prt && has_slash(short2str(cmd))) {
  1289.       xprintf("where: / in command makes no sense\n");
  1290.       return 0;
  1291.       }
  1292. ***************
  1293. *** 1042,1044 ****
  1294. --- 1123,1163 ----
  1295.       xfree((ptr_t) sv);
  1296.       return rval;
  1297.   }
  1298. + #ifdef __MINT__
  1299. + #include <process.h>
  1300. + int
  1301. + csh_execve(path, argv, envp)
  1302. +         char *path;
  1303. +         char **argv, **envp;
  1304. + {
  1305. +         char *newpath, *s;
  1306. +         Char **pv;
  1307. +         struct varent *v;
  1308. +         newpath = s = alloca(strlen(path) + 5);
  1309. +         while (*path) {
  1310. +                 *s++ = *path++;
  1311. +         }
  1312. +         *s = 0;
  1313. +         if (access(newpath, 0) == 0)
  1314. +                 return _spawnve(P_OVERLAY, newpath, argv, envp);
  1315. +         v = adrof(STRsuffixes);
  1316. +         if (v == 0)
  1317. +                 return -1;
  1318. +         *s++ = '.';
  1319. +         for (pv = v->vec; *pv; pv++) {
  1320. +                 strcpy(s, short2str(*pv));
  1321. +                 if (access(newpath, 0) == 0) {
  1322. +                         return _spawnve(P_OVERLAY, newpath, argv, envp);
  1323. +                 }
  1324. +         }
  1325. +         return -1;
  1326. + }
  1327. + #endif /* __MINT__ */
  1328. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.file.c ./sh.file.c
  1329. *** ../../store/tcsh-6.03/sh.file.c    Tue Nov 24 13:04:18 1992
  1330. --- ./sh.file.c    Fri Feb 26 01:26:22 1993
  1331. ***************
  1332. *** 407,413 ****
  1333.       if (old[0] != '~')
  1334.       return (Strcpy(new, old));
  1335.   
  1336. !     for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++);
  1337.       *p = '\0';
  1338.       if (person[0] == '\0')
  1339.       (void) Strcpy(new, value(STRhome));
  1340. --- 407,413 ----
  1341.       if (old[0] != '~')
  1342.       return (Strcpy(new, old));
  1343.   
  1344. !     for (p = person, o = &old[1]; *o && !is_dirsep(*o); *p++ = *o++);
  1345.       *p = '\0';
  1346.       if (person[0] == '\0')
  1347.       (void) Strcpy(new, value(STRhome));
  1348. ***************
  1349. *** 502,508 ****
  1350.   {
  1351.       register Char *p;
  1352.   
  1353. !     p = Strrchr(path, '/');
  1354.       if (p == NULL) {
  1355.       copyn(name, path, MAXNAMLEN);
  1356.       dir[0] = '\0';
  1357. --- 502,508 ----
  1358.   {
  1359.       register Char *p;
  1360.   
  1361. !     p = Lastslash(path);
  1362.       if (p == NULL) {
  1363.       copyn(name, path, MAXNAMLEN);
  1364.       dir[0] = '\0';
  1365. ***************
  1366. *** 590,596 ****
  1367.       if (items != NULL)
  1368.       FREE_ITEMS(items);
  1369.   
  1370. !     looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
  1371.       if (looking_for_lognames) {
  1372.   #ifndef _VMS_POSIX
  1373.       (void) setpwent();
  1374. --- 590,596 ----
  1375.       if (items != NULL)
  1376.       FREE_ITEMS(items);
  1377.   
  1378. !     looking_for_lognames = (*word == '~') && (Has_slash(word) == NULL);
  1379.       if (looking_for_lognames) {
  1380.   #ifndef _VMS_POSIX
  1381.       (void) setpwent();
  1382. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.func.c ./sh.func.c
  1383. *** ../../store/tcsh-6.03/sh.func.c    Tue Nov 24 13:04:20 1992
  1384. --- ./sh.func.c    Fri Feb 26 01:32:22 1993
  1385. ***************
  1386. *** 66,71 ****
  1387. --- 66,75 ----
  1388.   static    void    toend        __P((void));
  1389.   static    void    xecho        __P((int, Char **));
  1390.   
  1391. + #ifdef __MINT__
  1392. + extern  void    importsuffixes  __P((Char *));  /* in sh.c */
  1393. + #endif
  1394.   struct biltins *
  1395.   isbfunc(t)
  1396.       struct command *t;
  1397. ***************
  1398. *** 276,282 ****
  1399. --- 280,297 ----
  1400.       islogin();
  1401.       rechist(NULL);
  1402.       (void) signal(SIGTERM, parterm);
  1403. + #ifdef __MINT__
  1404. +     {
  1405. +         extern int csh_execve __P((char *, char **, char **)); /* in sh.exec.c */
  1406. +         extern char **environ;
  1407. +         char *args[3];
  1408. +         args[0] = "login"; args[1] = short2str(v[1]); args[2] = NULL;
  1409. +         (void)csh_execve(_PATH_LOGIN, args, environ);
  1410. +     }
  1411. + #else
  1412.       (void) execl(_PATH_LOGIN, "login", short2str(v[1]), NULL);
  1413. + #endif
  1414.       untty();
  1415.       xexit(1);
  1416.   }
  1417. ***************
  1418. *** 1190,1195 ****
  1419. --- 1205,1216 ----
  1420.       importpath(lp);
  1421.       dohash(NULL, NULL);
  1422.       }
  1423. + #ifdef __MINT__
  1424. +     else if (eq(vp, STRSUFFIXES)) {
  1425. +         importsuffixes(lp);
  1426. +         dohash(NULL, NULL);
  1427. +     }
  1428. + #endif /* __MINT__ */
  1429.   #ifdef apollo
  1430.       else if (eq(vp, STRSYSTYPE))
  1431.       dohash(NULL, NULL);
  1432. ***************
  1433. *** 1313,1318 ****
  1434. --- 1334,1343 ----
  1435.   
  1436.           if (eq(name, STRNOREBIND))
  1437.               NoNLSRebind = 0;
  1438. + #ifdef __MINT__
  1439. +                 else if (eq(name, STRSUFFIXES))
  1440. +                     dohash(NULL, NULL);
  1441. + #endif
  1442.   #ifdef apollo
  1443.           else if (eq(name, STRSYSTYPE))
  1444.               dohash(NULL, NULL);
  1445. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.glob.c ./sh.glob.c
  1446. *** ../../store/tcsh-6.03/sh.glob.c    Tue Nov 24 13:04:20 1992
  1447. --- ./sh.glob.c    Sun Mar  7 18:17:44 1993
  1448. ***************
  1449. *** 97,103 ****
  1450.       *gstart++ = *s++;
  1451.       u = s;
  1452.       for (b = gstart, e = &gbuf[BUFSIZE - 1]; 
  1453. !      *s && *s != '/' && *s != ':' && b < e;
  1454.        *b++ = *s++)
  1455.       continue;
  1456.       *b = EOS;
  1457. --- 97,103 ----
  1458.       *gstart++ = *s++;
  1459.       u = s;
  1460.       for (b = gstart, e = &gbuf[BUFSIZE - 1]; 
  1461. !      *s && !is_dirsep(*s) && *s != ':' && b < e;
  1462.        *b++ = *s++)
  1463.       continue;
  1464.       *b = EOS;
  1465. ***************
  1466. *** 135,141 ****
  1467.        * kfk - 17 Jan 1984 - stack hack allows user to get at arbitrary dir names
  1468.        * in stack. PWP: let =foobar pass through (for X windows)
  1469.        */
  1470. !     if (old[1] == '-' && (old[2] == '\0' || old[2] == '/')) {
  1471.       /* =- */
  1472.       dig = -1;
  1473.       b = &old[2];
  1474. --- 135,141 ----
  1475.        * kfk - 17 Jan 1984 - stack hack allows user to get at arbitrary dir names
  1476.        * in stack. PWP: let =foobar pass through (for X windows)
  1477.        */
  1478. !     if (old[1] == '-' && (old[2] == '\0' || is_dirsep(old[2]))) {
  1479.       /* =- */
  1480.       dig = -1;
  1481.       b = &old[2];
  1482. ***************
  1483. *** 145,151 ****
  1484.       dig = old[1] - '0';
  1485.       for (b = &old[2]; Isdigit(*b); b++)
  1486.           dig = dig * 10 + (*b - '0');
  1487. !     if (*b != '\0' && *b != '/')
  1488.           /* =<number>foobar */
  1489.           return old;
  1490.       }
  1491. --- 145,151 ----
  1492.       dig = old[1] - '0';
  1493.       for (b = &old[2]; Isdigit(*b); b++)
  1494.           dig = dig * 10 + (*b - '0');
  1495. !     if (*b != '\0' && !is_dirsep(*b))
  1496.           /* =<number>foobar */
  1497.           return old;
  1498.       }
  1499. ***************
  1500. *** 674,680 ****
  1501.           else if (isglob(*c))
  1502.           gflag |= G_GLOB;
  1503.           else if (symlinks == SYM_EXPAND && 
  1504. !         *p && ISDOTDOT(c) && (c == *(t-1) || *(c-1) == '/') )
  1505.               gflag |= G_CSH;
  1506.       }
  1507.       }
  1508. --- 674,680 ----
  1509.           else if (isglob(*c))
  1510.           gflag |= G_GLOB;
  1511.           else if (symlinks == SYM_EXPAND && 
  1512. !         *p && ISDOTDOT(c) && (c == *(t-1) || is_dirsep(*(c-1))) )
  1513.               gflag |= G_CSH;
  1514.       }
  1515.       }
  1516. ***************
  1517. *** 834,839 ****
  1518. --- 834,855 ----
  1519.           do
  1520.               icnt = read(pvec[0], tibuf, BUFSIZE);
  1521.           while (icnt == -1 && errno == EINTR);
  1522. + #ifdef DOSTEXT
  1523. +                 /* strip out carriage returns */
  1524. +                 {
  1525. +                         char *src, *dst;
  1526. +                         int i;
  1527. +                         src = dst = tibuf;
  1528. +                         for (i = icnt; i > 0; --i) {
  1529. +                                 if (*src == '\r')
  1530. +                                         --icnt;
  1531. +                                 else
  1532. +                                         *dst++ = *src;
  1533. +                                 src++;
  1534. +                         }
  1535. +                 }
  1536. + #endif
  1537.           if (icnt <= 0) {
  1538.               c = -1;
  1539.               break;
  1540. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.h ./sh.h
  1541. *** ../../store/tcsh-6.03/sh.h    Tue Nov 24 13:04:24 1992
  1542. --- ./sh.h    Fri Feb 26 01:46:40 1993
  1543. ***************
  1544. *** 177,183 ****
  1545.   #ifdef _SEQUENT_
  1546.   # include <sys/procstats.h>
  1547.   #endif /* _SEQUENT_ */
  1548. ! #if defined(POSIX) || SYSVREL > 0
  1549.   # include <sys/times.h>
  1550.   #endif /* POSIX || SYSVREL > 0 */
  1551.   
  1552. --- 177,183 ----
  1553.   #ifdef _SEQUENT_
  1554.   # include <sys/procstats.h>
  1555.   #endif /* _SEQUENT_ */
  1556. ! #if defined(POSIX) || SYSVREL > 0 || defined(__MINT__)
  1557.   # include <sys/times.h>
  1558.   #endif /* POSIX || SYSVREL > 0 */
  1559.   
  1560. ***************
  1561. *** 190,195 ****
  1562. --- 190,199 ----
  1563.   #endif /* _MINIX && vmsposix atp */
  1564.   #include <sys/stat.h>
  1565.   
  1566. + #ifdef __MINT__
  1567. + #include <support.h>
  1568. + #endif
  1569.   #if defined(BSDTIMES) || defined(BSDLIMIT)
  1570.   # include <sys/time.h>
  1571.   # if SYSVREL>3 && !defined(sgi)
  1572. ***************
  1573. *** 223,229 ****
  1574.   # include <sys/ttold.h>
  1575.   #endif /* sonyrisc */
  1576.   
  1577. ! #ifdef POSIX
  1578.   /*
  1579.    * We should be using setpgid and setpgid
  1580.    * by now, but in some systems we use the
  1581. --- 227,233 ----
  1582.   # include <sys/ttold.h>
  1583.   #endif /* sonyrisc */
  1584.   
  1585. ! #if defined(POSIX) || defined(__MINT__)
  1586.   /*
  1587.    * We should be using setpgid and setpgid
  1588.    * by now, but in some systems we use the
  1589. ***************
  1590. *** 289,294 ****
  1591. --- 293,305 ----
  1592.   
  1593.   #include <errno.h>
  1594.   
  1595. + #ifdef __MINT__
  1596. + /* undef E_SEEK from errno.h */
  1597. + # undef E_SEEK
  1598. + # define ENOTDIR EPATH
  1599. + # define ESPIPE EINVAL
  1600. + #endif
  1601.   #include <setjmp.h>
  1602.   
  1603.   #if __STDC__
  1604. ***************
  1605. *** 353,358 ****
  1606. --- 364,384 ----
  1607.   # endif 
  1608.   #endif 
  1609.   
  1610. + #ifndef DOSFS
  1611. + # define is_dirsep(c)   ((c) == '/')
  1612. + # define is_abspath(p)  (is_dirsep(*(p)))
  1613. + # define lastslash(p)   (strrchr((p), '/'))
  1614. + # define Lastslash(p)   (Strrchr((p), '/'))
  1615. + # define has_slash(p)   (any((p), '/'))
  1616. + # define Has_slash(p)   (Strrchr((p), '/'))
  1617. + #else
  1618. + extern int      is_dirsep       __P((int));
  1619. + extern int      is_abspath      __P((Char *));
  1620. + extern char *   lastslash       __P((char *));
  1621. + extern Char *   Lastslash       __P((Char *));
  1622. + extern int      has_slash       __P((char *));
  1623. + extern int      Has_slash       __P((Char *));
  1624. + #endif
  1625.   
  1626.   typedef int bool;
  1627.   
  1628. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.lex.c ./sh.lex.c
  1629. *** ../../store/tcsh-6.03/sh.lex.c    Tue Nov 24 13:04:20 1992
  1630. --- ./sh.lex.c    Fri Feb 26 02:05:56 1993
  1631. ***************
  1632. *** 430,436 ****
  1633.       for (;;) {
  1634.       if ((c = peekc) != 0) {
  1635.           peekc = 0;
  1636. !         return (c);
  1637.       }
  1638.       if (lap) {
  1639.           if ((c = *lap++) == 0)
  1640. --- 430,436 ----
  1641.       for (;;) {
  1642.       if ((c = peekc) != 0) {
  1643.           peekc = 0;
  1644. !         goto ret_c;
  1645.       }
  1646.       if (lap) {
  1647.           if ((c = *lap++) == 0)
  1648. ***************
  1649. *** 438,453 ****
  1650.           else {
  1651.           if (cmap(c, _META | _Q | _Q1))
  1652.               c |= QUOTE;
  1653. !         return (c);
  1654.           }
  1655.       }
  1656.       if ((c = peekd) != 0) {
  1657.           peekd = 0;
  1658. !         return (c);
  1659.       }
  1660.       if (exclp) {
  1661.           if ((c = *exclp++) != 0)
  1662. !         return (c);
  1663.           if (exclnxt && --exclc >= 0) {
  1664.           exclnxt = exclnxt->next;
  1665.           setexclp(exclnxt->word);
  1666. --- 438,453 ----
  1667.           else {
  1668.           if (cmap(c, _META | _Q | _Q1))
  1669.               c |= QUOTE;
  1670. !         goto ret_c;
  1671.           }
  1672.       }
  1673.       if ((c = peekd) != 0) {
  1674.           peekd = 0;
  1675. !         goto ret_c;
  1676.       }
  1677.       if (exclp) {
  1678.           if ((c = *exclp++) != 0)
  1679. !         goto ret_c;
  1680.           if (exclnxt && --exclc >= 0) {
  1681.           exclnxt = exclnxt->next;
  1682.           setexclp(exclnxt->word);
  1683. ***************
  1684. *** 475,481 ****
  1685. --- 475,486 ----
  1686.       }
  1687.       break;
  1688.       }
  1689. + ret_c:
  1690. + #ifdef DOSTEXT
  1691. +     return (c == '\r' ? getC1(flag) : c);
  1692. + #else
  1693.       return (c);
  1694. + #endif
  1695.   }
  1696.   
  1697.   static void
  1698. ***************
  1699. *** 1125,1134 ****
  1700.   
  1701.       case 'h':
  1702.       case 't':
  1703. !     if (!any(short2str(cp), '/'))
  1704.           return (type == 't' ? Strsave(cp) : 0);
  1705.       wp = Strend(cp);
  1706. !     while (*--wp != '/')
  1707.           continue;
  1708.       if (type == 'h')
  1709.           xp = Strsave(cp), xp[wp - cp] = 0;
  1710. --- 1130,1139 ----
  1711.   
  1712.       case 'h':
  1713.       case 't':
  1714. !     if (!has_slash(short2str(cp)))
  1715.           return (type == 't' ? Strsave(cp) : 0);
  1716.       wp = Strend(cp);
  1717. !     while (!is_dirsep(*--wp))
  1718.           continue;
  1719.       if (type == 'h')
  1720.           xp = Strsave(cp), xp[wp - cp] = 0;
  1721. ***************
  1722. *** 1139,1145 ****
  1723.       case 'e':
  1724.       case 'r':
  1725.       wp = Strend(cp);
  1726. !     for (wp--; wp >= cp && *wp != '/'; wp--)
  1727.           if (*wp == '.') {
  1728.           if (type == 'e')
  1729.               xp = Strsave(wp + 1);
  1730. --- 1144,1150 ----
  1731.       case 'e':
  1732.       case 'r':
  1733.       wp = Strend(cp);
  1734. !     for (wp--; wp >= cp && !is_dirsep(*wp); wp--)
  1735.           if (*wp == '.') {
  1736.           if (type == 'e')
  1737.               xp = Strsave(wp + 1);
  1738. ***************
  1739. *** 1622,1628 ****
  1740.       }
  1741.       c = fbuf[0][fseekp - fbobp];
  1742.       fseekp++;
  1743. !     return (c);
  1744.       }
  1745.   again:
  1746.       buf = (int) fseekp / BUFSIZE;
  1747. --- 1627,1633 ----
  1748.       }
  1749.       c = fbuf[0][fseekp - fbobp];
  1750.       fseekp++;
  1751. !     goto ret_c;
  1752.       }
  1753.   again:
  1754.       buf = (int) fseekp / BUFSIZE;
  1755. ***************
  1756. *** 1699,1705 ****
  1757. --- 1704,1716 ----
  1758.       }
  1759.       c = fbuf[buf][(int) fseekp % BUFSIZE];
  1760.       fseekp++;
  1761. + ret_c:
  1762. + #ifdef DOSTEXT
  1763. +     return (c == '\r' ? bgetc() : c);
  1764. + #else
  1765.       return (c);
  1766. + #endif
  1767.   }
  1768.   
  1769.   static void
  1770. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.misc.c ./sh.misc.c
  1771. *** ../../store/tcsh-6.03/sh.misc.c    Tue Nov 24 13:04:20 1992
  1772. --- ./sh.misc.c    Mon Mar  8 20:35:22 1993
  1773. ***************
  1774. *** 38,43 ****
  1775. --- 38,47 ----
  1776.   
  1777.   RCSID("$Id: sh.misc.c,v 3.17 1992/10/18 00:43:08 christos Exp $")
  1778.   
  1779. + #ifdef __MINT__
  1780. + extern int __mint;      /* kernel version */
  1781. + #endif
  1782.   static    int    renum    __P((int, int));
  1783.   static  Char  **blkend    __P((Char **));
  1784.   static  Char  **blkcat    __P((Char **, Char **));
  1785. ***************
  1786. *** 270,275 ****
  1787. --- 274,285 ----
  1788.   {
  1789.       register int f;
  1790.   
  1791. + #ifdef __MINT__
  1792. + /* in TOS, all handles are shared by all processes! (ack!) */
  1793. +     if (__mint == 0)
  1794. +         return;
  1795. + #endif
  1796.       if (didcch)
  1797.       return;
  1798.       didcch = 1;
  1799. ***************
  1800. *** 308,313 ****
  1801. --- 318,326 ----
  1802.       if (i == j || i < 0)
  1803.       return (i);
  1804.   #ifdef HAVEDUP2
  1805. + # ifdef __MINT__
  1806. +     if (__mint != 0)    /* TOS screws up dup2 */
  1807. + # endif
  1808.       if (j >= 0) {
  1809.       (void) dup2(i, j);
  1810.       if (j != i)
  1811. ***************
  1812. *** 328,333 ****
  1813. --- 341,351 ----
  1814.   
  1815.       if (i == j || i < 0 || (j < 0 && i > 2))
  1816.       return (i);
  1817. + #ifdef __MINT__
  1818. +     if (__mint == 0 && j > 5) {
  1819. +         return (i <= 5) ? dup(i) : j;
  1820. +     }
  1821. + #endif
  1822.       if (j >= 0) {
  1823.   #ifdef HAVEDUP2
  1824.       (void) dup2(i, j);
  1825. ***************
  1826. *** 464,466 ****
  1827. --- 482,567 ----
  1828.           return (0);
  1829.       }
  1830.   }
  1831. + #ifdef DOSFS
  1832. + int
  1833. + is_dirsep(i)
  1834. +         int i;
  1835. + {
  1836. +         return i == '/' || i == '\\' ;
  1837. + }
  1838. + int
  1839. + is_abspath(pth)
  1840. +         register Char *pth;
  1841. + {
  1842. +         return is_dirsep(TRM(*pth)) || TRM(pth[1]) == ':';
  1843. + }
  1844. + char *
  1845. + lastslash(pth)
  1846. +         register char *pth;
  1847. + {
  1848. +         register char *slash = 0, *s = pth, c;
  1849. +         if (! s) return 0;
  1850. +         while ( (c = *s++) != 0) {
  1851. +                 if (is_dirsep(c))
  1852. +                         slash = s - 1;
  1853. +         }
  1854. +         if (slash)
  1855. +                 return slash;
  1856. +         return (pth[1] == ':') ? pth : 0;
  1857. + }
  1858. + Char *
  1859. + Lastslash(pth)
  1860. +         register Char *pth;
  1861. + {
  1862. +         register Char *slash = 0, *s = pth, c;
  1863. +         if (! s) return 0;
  1864. +         while ( (c = *s++) != 0) {
  1865. +                 if (is_dirsep(c))
  1866. +                         slash = s - 1;
  1867. +         }
  1868. +         if (slash)
  1869. +                 return slash;
  1870. +         return (pth[1] == ':') ? pth : 0;
  1871. + }
  1872. + int
  1873. + has_slash(pth)
  1874. +         register char *pth;
  1875. + {
  1876. +         register char c;
  1877. +         if (! pth) return 0;
  1878. +         while ( (c = *pth++) != 0)
  1879. +                 if (is_dirsep(c))
  1880. +                         return 1;
  1881. +         return 0;
  1882. + }
  1883. + int
  1884. + Has_slash(pth)
  1885. +         register Char *pth;
  1886. + {
  1887. +         register Char c;
  1888. +         if (! pth) return 0;
  1889. +         while ( (c = *pth++) != 0)
  1890. +                 if (is_dirsep(c))
  1891. +                         return 1;
  1892. +         return 0;
  1893. + }
  1894. + #endif /* DOSFS */
  1895. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.proc.c ./sh.proc.c
  1896. *** ../../store/tcsh-6.03/sh.proc.c    Tue Nov 24 13:04:22 1992
  1897. --- ./sh.proc.c    Fri Feb 26 02:23:04 1993
  1898. ***************
  1899. *** 83,94 ****
  1900.                   0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
  1901.   
  1902.   # else /* !SUNOS4 && !hp9000 */
  1903. ! #  ifdef masscomp
  1904.   /*
  1905.    * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic
  1906.    * because the first two elements are unions of a time_t and a struct timeval.
  1907.    * So we'll just have to trust the loader to do the "right thing", DAS DEC-90.
  1908.    */
  1909.   static struct rusage zru;
  1910.   #  else    /* masscomp */
  1911.   static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, 
  1912. --- 83,97 ----
  1913.                   0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
  1914.   
  1915.   # else /* !SUNOS4 && !hp9000 */
  1916. ! #  if defined(masscomp) || defined(__MINT__)
  1917.   /*
  1918.    * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic
  1919.    * because the first two elements are unions of a time_t and a struct timeval.
  1920.    * So we'll just have to trust the loader to do the "right thing", DAS DEC-90.
  1921.    */
  1922. + /* MiNT is missing a lot of fields, so we also trust the loader (we can
  1923. +  * trust it) to avoid getting errors from the compiler
  1924. +  */
  1925.   static struct rusage zru;
  1926.   #  else    /* masscomp */
  1927.   static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, 
  1928. ***************
  1929. *** 119,124 ****
  1930. --- 122,145 ----
  1931.   static    struct process    *pgetcurr    __P((struct process *));
  1932.   static    void         okpcntl    __P((void));
  1933.   
  1934. + #ifdef __MINT__
  1935. + /*
  1936. +  * MiNT's fork() is a lot like vfork() in some respects; in particular,
  1937. +  * if we set job control signals to SIG_DFL after fork() and then
  1938. +  * get a signal, our parent will never be able to reclaim the address
  1939. +  * space and everything will hang :-(. Solution: rather than SIG_DFL,
  1940. +  * set the signals to a null signal handler; if we exec(), they will
  1941. +  * be set to SIG_DFL automatically, and before then the signals will
  1942. +  * effectively be ignored.
  1943. +  */
  1944. + void
  1945. + sig_tmp_ign(int sig)
  1946. + {
  1947. + /* do nothing, and rely on the magic of restartable system calls :-) */
  1948. + }
  1949. + #endif
  1950.   /*
  1951.    * pchild - called at interrupt level by the SIGCHLD signal
  1952.    *    indicating that at least one child has terminated or stopped
  1953. ***************
  1954. *** 1856,1865 ****
  1955. --- 1877,1893 ----
  1956.           (void) signal(SIGQUIT, ignint ? SIG_IGN : SIG_DFL);
  1957.   #ifdef BSDJOBS
  1958.           if (wanttty >= 0) {
  1959. + # ifdef __MINT__
  1960. + /* see comments for sig_tmp_ign above */
  1961. +                 (void) signal(SIGTSTP, sig_tmp_ign);
  1962. +                 (void) signal(SIGTTIN, sig_tmp_ign);
  1963. +                 (void) signal(SIGTTOU, sig_tmp_ign);
  1964. + # else
  1965.           /* make stoppable */
  1966.           (void) signal(SIGTSTP, SIG_DFL);
  1967.           (void) signal(SIGTTIN, SIG_DFL);
  1968.           (void) signal(SIGTTOU, SIG_DFL);
  1969. + # endif
  1970.           }
  1971.   #endif /* BSDJOBS */
  1972.           (void) signal(SIGTERM, parterm);
  1973. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.sem.c ./sh.sem.c
  1974. *** ../../store/tcsh-6.03/sh.sem.c    Tue Nov 24 13:04:22 1992
  1975. --- ./sh.sem.c    Fri Feb 26 02:36:24 1993
  1976. ***************
  1977. *** 489,497 ****
  1978. --- 489,506 ----
  1979.               }
  1980.   # ifdef BSDJOBS
  1981.               if (_gv.wanttty >= 0) {
  1982. + #  ifdef __MINT__
  1983. + /* see sh.proc.c */
  1984. +                             extern void sig_tmp_ign();
  1985. +                             (void) signal(SIGTSTP, sig_tmp_ign);
  1986. +                             (void) signal(SIGTTIN, sig_tmp_ign);
  1987. +                             (void) signal(SIGTTOU, sig_tmp_ign);
  1988. + #  else
  1989.                   (void) signal(SIGTSTP, SIG_DFL);
  1990.                   (void) signal(SIGTTIN, SIG_DFL);
  1991.                   (void) signal(SIGTTOU, SIG_DFL);
  1992. + #  endif
  1993.               }
  1994.   # endif /* BSDJOBS */
  1995.   
  1996. ***************
  1997. *** 612,619 ****
  1998. --- 621,630 ----
  1999.       execute(t->t_dcdr, _gv.wanttty, pv, pipeout);
  2000.       t->t_dcar->t_dflg |= F_PIPEOUT |
  2001.           (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT));
  2002. + # ifndef __MINT__
  2003.       if (_gv.wanttty > 0)
  2004.           _gv.wanttty = 0;    /* got tty already */
  2005. + # endif
  2006.       execute(t->t_dcar, _gv.wanttty, pipein, pv);
  2007.   #else /* !BACKPIPE */
  2008.       t->t_dcar->t_dflg |= F_PIPEOUT |
  2009. ***************
  2010. *** 621,628 ****
  2011. --- 632,641 ----
  2012.       execute(t->t_dcar, _gv.wanttty, pipein, pv);
  2013.       t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg &
  2014.               (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT));
  2015. + # ifndef __MINT__
  2016.       if (_gv.wanttty > 0)
  2017.           _gv.wanttty = 0;    /* got tty already */
  2018. + # endif
  2019.       execute(t->t_dcdr, _gv.wanttty, pv, pipeout);
  2020.   #endif /* BACKPIPE */
  2021.       break;
  2022. ***************
  2023. *** 795,812 ****
  2024. --- 808,839 ----
  2025.           (void) dmove(fd, 0);
  2026.       }
  2027.       else if (flags & F_PIPEIN) {
  2028. + #ifdef __MINT__
  2029. +             (void) dup2(pipein[0], 0);
  2030. + #else
  2031.           (void) close(0);
  2032.           (void) dup(pipein[0]);
  2033. + #endif
  2034.           (void) close(pipein[0]);
  2035.           (void) close(pipein[1]);
  2036.       }
  2037.       else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
  2038. + #ifdef __MINT__
  2039. +             int fd = open(_PATH_DEVNULL, O_RDONLY);
  2040. +             (void) dup2(fd, 0);
  2041. +             (void) close(fd);
  2042. + #else
  2043.           (void) close(0);
  2044.           (void) open(_PATH_DEVNULL, O_RDONLY);
  2045. + #endif
  2046.       }
  2047.       else {
  2048. + #ifdef __MINT__
  2049. +             (void) dup2(OLDSTD, 0);
  2050. + #else
  2051.           (void) close(0);
  2052.           (void) dup(OLDSTD);
  2053. + #endif
  2054.   #if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  2055.           /*
  2056.            * PWP: Unlike Bezerkeley 4.3, FIONCLEX for Pyramid is preserved
  2057. ***************
  2058. *** 853,865 ****
  2059. --- 880,900 ----
  2060.       is1atty = isatty(1);
  2061.       }
  2062.       else if (flags & F_PIPEOUT) {
  2063. + #ifdef __MINT__
  2064. +         (void) dup2(pipeout[1], 1);
  2065. + #else
  2066.       (void) close(1);
  2067.       (void) dup(pipeout[1]);
  2068. + #endif
  2069.       is1atty = 0;
  2070.       }
  2071.       else {
  2072. + #ifdef __MINT__
  2073. +         (void) dup2(SHOUT, 1);
  2074. + #else
  2075.       (void) close(1);
  2076.       (void) dup(SHOUT);
  2077. + #endif
  2078.       is1atty = isoutatty;
  2079.   # if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  2080.       (void) close_on_exec(1, 0);
  2081. ***************
  2082. *** 868,878 ****
  2083. --- 903,921 ----
  2084.   
  2085.       (void) close(2);
  2086.       if (flags & F_STDERR) {
  2087. + #ifdef __MINT__
  2088. +         (void) dup2(1, 2);
  2089. + #else
  2090.       (void) dup(1);
  2091. + #endif
  2092.       is2atty = is1atty;
  2093.       }
  2094.       else {
  2095. + #ifdef __MINT__
  2096. +         (void) dup2(SHDIAG, 2);
  2097. + #else
  2098.       (void) dup(SHDIAG);
  2099. + #endif
  2100.       is2atty = isdiagatty;
  2101.   # if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  2102.       (void) close_on_exec(2, 0);
  2103. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.set.c ./sh.set.c
  2104. *** ../../store/tcsh-6.03/sh.set.c    Tue Nov 24 13:04:22 1992
  2105. --- ./sh.set.c    Mon Mar  8 05:43:22 1993
  2106. ***************
  2107. *** 54,59 ****
  2108. --- 54,62 ----
  2109.   static    struct varent    *madrof        __P((Char *, struct varent *));
  2110.   static    void         unsetv1    __P((struct varent *));
  2111.   static    void         exportpath    __P((Char **));
  2112. + #ifdef __MINT__
  2113. + static  void             exportsuffixes __P((Char **));
  2114. + #endif
  2115.   static    void         balance    __P((struct varent *, int, int));
  2116.   
  2117.   /*
  2118. ***************
  2119. *** 68,73 ****
  2120. --- 71,82 ----
  2121.       exportpath(adrof(STRpath)->vec);
  2122.       dohash(NULL, NULL);
  2123.       }
  2124. + #ifdef __MINT__
  2125. +     else if (eq(vp, STRsuffixes)) {
  2126. +         exportsuffixes(adrof(STRsuffixes)->vec);
  2127. +         dohash(NULL, NULL);
  2128. +     }
  2129. + #endif
  2130.       else if (eq(vp, STRhistchars)) {
  2131.       register Char *pn = value(vp);
  2132.   
  2133. ***************
  2134. *** 418,424 ****
  2135.       }
  2136.       else {
  2137.       num = 4;        /* confuse lint */
  2138. !     if (sizeof(int) == num && ((unsigned int) n) == 2147483648) {
  2139.           *putp++ = '2';
  2140.           n = 147483648;
  2141.       }
  2142. --- 427,433 ----
  2143.       }
  2144.       else {
  2145.       num = 4;        /* confuse lint */
  2146. !     if (sizeof(int) == num && ((unsigned int) n) == 2147483648U) {
  2147.           *putp++ = '2';
  2148.           n = 147483648;
  2149.       }
  2150. ***************
  2151. *** 731,736 ****
  2152. --- 740,769 ----
  2153.       tsetenv(STRKPATH, exppath);
  2154.   }
  2155.   
  2156. + #ifdef __MINT__
  2157. + static void
  2158. + exportsuffixes(val)
  2159. +     Char  **val;
  2160. + {
  2161. +     Char    expsuff[BUFSIZE];
  2162. +     static Char STRcomma[] = { ',' , '\0' };
  2163. +     expsuff[0] = 0;
  2164. +     if (val)
  2165. +         while (*val) {
  2166. +             if (Strlen(*val) + Strlen(expsuff) + 2 > BUFSIZE) {
  2167. +                 xprintf("Warning: ridiculously long SUFFIXES truncated\n");
  2168. +                 break;
  2169. +             }
  2170. +             (void) Strcat(expsuff, *val++);
  2171. +             if (*val == 0 || eq(*val, STRRparen))
  2172. +                 break;
  2173. +             (void) Strcat(expsuff, STRcomma);
  2174. +         }
  2175. +     tsetenv(STRSUFFIXES, expsuff);
  2176. + }
  2177. + #endif /* __MINT__ */
  2178.   #ifndef lint
  2179.    /*
  2180.     * Lint thinks these have null effect
  2181. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.time.c ./sh.time.c
  2182. *** ../../store/tcsh-6.03/sh.time.c    Tue Nov 24 13:04:22 1992
  2183. --- ./sh.time.c    Fri Feb 26 02:46:54 1993
  2184. ***************
  2185. *** 178,183 ****
  2186. --- 178,184 ----
  2187.   {
  2188.       tvadd(&ru->ru_utime, &ru2->ru_utime);
  2189.       tvadd(&ru->ru_stime, &ru2->ru_stime);
  2190. + #ifndef __MINT__
  2191.       if (ru2->ru_maxrss > ru->ru_maxrss)
  2192.       ru->ru_maxrss = ru2->ru_maxrss;
  2193.   
  2194. ***************
  2195. *** 194,199 ****
  2196. --- 195,201 ----
  2197.       ru->ru_nsignals += ru2->ru_nsignals;
  2198.       ru->ru_nvcsw += ru2->ru_nvcsw;
  2199.       ru->ru_nivcsw += ru2->ru_nivcsw;
  2200. + #endif
  2201.   }
  2202.   
  2203.   #else /* BSDTIMES */
  2204. ***************
  2205. *** 325,331 ****
  2206. --- 327,337 ----
  2207.       int     ms =
  2208.       (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
  2209.   
  2210. + # ifdef __MINT__
  2211. +     cp = "%Uu %Ss %E %P";
  2212. + # else
  2213.       cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww";
  2214. + # endif
  2215.   #else
  2216.   # ifdef _SEQUENT_
  2217.       int     ms =
  2218. ***************
  2219. *** 416,422 ****
  2220.           xprintf("%ld.%01ld%%", i / 10, i % 10);    /* nn.n% */
  2221.           break;
  2222.   
  2223. ! #ifdef BSDTIMES
  2224.           case 'W':        /* number of swaps */
  2225.           i = r1->ru_nswap - r0->ru_nswap;
  2226.           xprintf("%ld", i);
  2227. --- 422,428 ----
  2228.           xprintf("%ld.%01ld%%", i / 10, i % 10);    /* nn.n% */
  2229.           break;
  2230.   
  2231. ! #if defined(BSDTIMES) && !defined(__MINT__)
  2232.           case 'W':        /* number of swaps */
  2233.           i = r1->ru_nswap - r0->ru_nswap;
  2234.           xprintf("%ld", i);
  2235. diff --context --new-file --recursive ../../store/tcsh-6.03/sh.types.h ./sh.types.h
  2236. *** ../../store/tcsh-6.03/sh.types.h    Tue Nov 24 13:04:34 1992
  2237. --- ./sh.types.h    Sat Mar 13 23:58:14 1993
  2238. ***************
  2239. *** 487,492 ****
  2240. --- 487,502 ----
  2241.   # endif /* _SIZE_T */
  2242.   #endif /* _VMS_POSIX */
  2243.   
  2244. + /*
  2245. +  *  MiNT
  2246. +  */
  2247. + #ifdef __MINT__
  2248. + # ifndef _SIGMASK_T
  2249. + #  define _SIGMASK_T
  2250. +    typedef long sigmask_t;
  2251. + # endif
  2252. + #endif
  2253.   /***
  2254.    *** Catch all for non POSIX and/or non ANSI systems.
  2255.    *** Systems up to spec *should* define these automatically
  2256. diff --context --new-file --recursive ../../store/tcsh-6.03/sldiffs ./sldiffs
  2257. *** ../../store/tcsh-6.03/sldiffs
  2258. --- ./sldiffs    Sun Mar  7 18:07:24 1993
  2259. ***************
  2260. *** 0 ****
  2261. --- 1,3012 ----
  2262. + Common subdirectories: /usr/users/staff/hohmuth/tmp/tcsh-6.03/config and ./config
  2263. + Only in .: config.h
  2264. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/config_f.h ./config_f.h
  2265. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/config_f.h    Tue Nov 24 13:04:38 1992
  2266. + --- ./config_f.h    Fri Feb 26 04:17:40 1993
  2267. + ***************
  2268. + *** 56,62 ****
  2269. +    *        if you don't have <locale.h>, you don't want
  2270. +    *        to define this.
  2271. +    */
  2272. + ! #define NLS
  2273. +   
  2274. +   /*
  2275. +    * LOGINFIRST   Source ~/.login before ~/.cshrc
  2276. + --- 56,62 ----
  2277. +    *        if you don't have <locale.h>, you don't want
  2278. +    *        to define this.
  2279. +    */
  2280. + ! #undef NLS
  2281. +   
  2282. +   /*
  2283. +    * LOGINFIRST   Source ~/.login before ~/.cshrc
  2284. + ***************
  2285. + *** 90,96 ****
  2286. +    *        on the name of the tty, and environment.
  2287. +    *        Does not make sense in the modern window systems!
  2288. +    */
  2289. + ! #define AUTOLOGOUT
  2290. +   
  2291. +   /*
  2292. +    * SUSPENDED    Newer shells say 'Suspended' instead of 'Stopped'.
  2293. + --- 90,96 ----
  2294. +    *        on the name of the tty, and environment.
  2295. +    *        Does not make sense in the modern window systems!
  2296. +    */
  2297. + ! #undef AUTOLOGOUT
  2298. +   
  2299. +   /*
  2300. +    * SUSPENDED    Newer shells say 'Suspended' instead of 'Stopped'.
  2301. + ***************
  2302. + *** 115,120 ****
  2303. + --- 115,137 ----
  2304. +   #else
  2305. +   # undef SYSMALLOC
  2306. +   #endif
  2307. + + 
  2308. + + #if 0
  2309. + + # ifndef SYSMALLOC
  2310. + + #  define SYSMALLOC
  2311. + + # endif
  2312. + + #endif
  2313. + + 
  2314. + + /*
  2315. + +  * DOSFS      Support DOS filessystems (which have a 12345678.123 limit),
  2316. + +  *            and allow backslashes as path separators
  2317. + +  */
  2318. + + #define DOSFS
  2319. + + 
  2320. + + /*
  2321. + +  * DOSTEXT    Support DOS text mode/files (ignore 0x0d)
  2322. + +  */
  2323. + + #define DOSTEXT
  2324. +   
  2325. +   /*
  2326. +    * RCSID    This defines if we want rcs strings in the binary or not
  2327. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/ed,init.c ./ed,init.c
  2328. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/ed,init.c    Tue Nov 24 13:04:28 1992
  2329. + --- ./ed,init.c    Thu Feb 25 04:30:40 1993
  2330. + ***************
  2331. + *** 626,631 ****
  2332. + --- 626,649 ----
  2333. +       char    buf[BUFSIZE];
  2334. +   
  2335. +       chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZE - 1));
  2336. + + 
  2337. + + # ifdef DOSTEXT
  2338. + +         /* strip out carriage returns */
  2339. + +         if (chrs > 0) {
  2340. + +                 char *src, *dst;
  2341. + +                 int i;
  2342. + + 
  2343. + +                 src = dst = buf;
  2344. + +                 for (i = chrs; i > 0; --i) {
  2345. + +                         if (*src == '\r')
  2346. + +                                 --chrs;
  2347. + +                         else
  2348. + +                                 *dst++ = *src;
  2349. + +                         src++;
  2350. + +                 }
  2351. + +         }
  2352. + + # endif
  2353. + + 
  2354. +       if (chrs > 0) {
  2355. +           buf[chrs] = '\0';
  2356. +           Input_Line = Strsave(str2short(buf));
  2357. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/ed,input.c ./ed,input.c
  2358. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/ed,input.c    Tue Nov 24 13:04:30 1992
  2359. + --- ./ed,input.c    Thu Feb 25 04:33:52 1993
  2360. + ***************
  2361. + *** 99,105 ****
  2362. +       if (!Tty_raw_mode && MacroLvl < 0) {
  2363. +       long    chrs = 0;
  2364. +   
  2365. + !     (void) ioctl(SHIN, FIONREAD, (ioctl_t) & chrs);
  2366. +       if (chrs == 0) {
  2367. +           if (Rawmode() < 0)
  2368. +           return 0;
  2369. + --- 99,111 ----
  2370. +       if (!Tty_raw_mode && MacroLvl < 0) {
  2371. +       long    chrs = 0;
  2372. +   
  2373. + ! # ifndef __MINT__
  2374. + ! /* MiNT _always_ wants to go into raw mode, so don't bother with the
  2375. + !  * FIONREAD test
  2376. + !  */
  2377. + !         (void) ioctl(SHIN, FIONREAD, (ioctl_t) & chrs);
  2378. + ! # endif
  2379. + ! 
  2380. +       if (chrs == 0) {
  2381. +           if (Rawmode() < 0)
  2382. +           return 0;
  2383. + Only in .: foobar
  2384. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/makefile ./makefile
  2385. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/makefile    Tue Nov 24 13:04:36 1992
  2386. + --- ./makefile    Tue Feb 23 21:48:04 1993
  2387. + ***************
  2388. + *** 7,12 ****
  2389. + --- 7,16 ----
  2390. +   # With an input editor, command completion, etc. and ported to all sorts of
  2391. +   # things; Paul Placeway, CIS Dept., Ohio State University
  2392. +   #
  2393. + + 
  2394. + + CROSSDIR = /usr/users1/mat91/mh1/atari/cross-gcc
  2395. + + CROSSBIN = $(CROSSDIR)/bin
  2396. + + 
  2397. +   SHELL=/bin/sh
  2398. +   VERSION=6.03
  2399. +   BUILD=tcsh
  2400. + ***************
  2401. + *** 49,58 ****
  2402. +   #CFLAGS=-O $(INCLUDES)
  2403. +   
  2404. +   # gcc-2.1
  2405. + ! CFLAGS=-O2 $(INCLUDES)
  2406. +   
  2407. +   # gcc 2.1 on linux
  2408. + ! #CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
  2409. +   
  2410. +   #hpux 8.0
  2411. +   #CFLAGS= $(INCLUDES) +O3 -Aa
  2412. + --- 53,63 ----
  2413. +   #CFLAGS=-O $(INCLUDES)
  2414. +   
  2415. +   # gcc-2.1
  2416. + ! #CFLAGS=-O2 $(INCLUDES)
  2417. +   
  2418. +   # gcc 2.1 on linux
  2419. + ! # MiNT
  2420. + ! CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
  2421. +   
  2422. +   #hpux 8.0
  2423. +   #CFLAGS= $(INCLUDES) +O3 -Aa
  2424. + ***************
  2425. + *** 117,123 ****
  2426. +   ################################################################
  2427. +   ## LIBES.  Pick one, or roll your own.
  2428. +   ################################################################
  2429. + ! LIBES= -ltermcap         ## BSD style things, hpux
  2430. +   #LIBES= -ltermc            ## emx under OS/2
  2431. +   #LIBES= -ltermcap -lsec        ## Tek XD88/10 (UTekV) with PW_SHADOW
  2432. +   #LIBES= -ltermcap -lsec        ## Motorola MPC (sysV88) with PW_SHADOW
  2433. + --- 122,128 ----
  2434. +   ################################################################
  2435. +   ## LIBES.  Pick one, or roll your own.
  2436. +   ################################################################
  2437. + ! #LIBES= -ltermcap         ## BSD style things, hpux
  2438. +   #LIBES= -ltermc            ## emx under OS/2
  2439. +   #LIBES= -ltermcap -lsec        ## Tek XD88/10 (UTekV) with PW_SHADOW
  2440. +   #LIBES= -ltermcap -lsec        ## Motorola MPC (sysV88) with PW_SHADOW
  2441. + ***************
  2442. + *** 152,157 ****
  2443. + --- 157,163 ----
  2444. +   #LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
  2445. +   #LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
  2446. +   #LIBES= -ltermcap -lauth        ## for Ultrix with Enhanced Security
  2447. + + LIBES=    -lbtermcap        ## when compiling with -mbaserel in MiNT
  2448. +   
  2449. +   
  2450. +   # The difficult choice of a c-compiler...
  2451. + ***************
  2452. + *** 164,170 ****
  2453. +   
  2454. +   # The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
  2455. +   # on the suns does not know how to make dynamically linked binaries.
  2456. + ! CC=    gcc -Wall -B/bin/    
  2457. +   #CC=    gcc -m486 -Wall # Generate code for Intel 486 (linux)
  2458. +   #CC=    cc
  2459. +   #CC=    occ
  2460. + --- 170,176 ----
  2461. +   
  2462. +   # The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
  2463. +   # on the suns does not know how to make dynamically linked binaries.
  2464. + ! #CC=    gcc -Wall -B/bin/    
  2465. +   #CC=    gcc -m486 -Wall # Generate code for Intel 486 (linux)
  2466. +   #CC=    cc
  2467. +   #CC=    occ
  2468. + ***************
  2469. + *** 173,178 ****
  2470. + --- 179,187 ----
  2471. +   #CC=    /bin/cc    # For suns, w/o gcc and SVR4
  2472. +   #CC=    /usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
  2473. +   #CC=    scc     # Alliant fx2800
  2474. + + #CC=    $(CROSSBIN)/cgcc -Wall
  2475. + + CC=    gcc -Wall
  2476. + + 
  2477. +   ED=    ed
  2478. +   AS=    as
  2479. +   RM=    rm
  2480. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/pathname.h ./pathname.h
  2481. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/pathname.h    Tue Nov 24 13:04:38 1992
  2482. + --- ./pathname.h    Thu Feb 25 04:36:08 1993
  2483. + ***************
  2484. + *** 69,74 ****
  2485. + --- 69,80 ----
  2486. +   # endif /* !_PATH_DOTCSHRC */
  2487. +   #endif /* NeXT */
  2488. +   
  2489. + + #ifdef DOSFS
  2490. + + # define _PATH_DOTLOGIN         "/etc/login.csh"
  2491. + + # define _PATH_DOTLOGOUT        "/etc/logout.csh"
  2492. + + # define _PATH_DOTCSHRC         "/etc/cshrc.csh"
  2493. + + #endif
  2494. + + 
  2495. +   #if defined(sgi) || defined(OREO) || defined(cray) || defined(AMIX) || defined(CDC)
  2496. +   # ifndef _PATH_DOTLOGIN
  2497. +   #  define _PATH_DOTLOGIN    "/etc/cshrc"
  2498. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,char.c ./sh,char.c
  2499. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,char.c    Tue Nov 24 13:04:18 1992
  2500. + --- ./sh,char.c    Thu Feb 25 04:57:24 1993
  2501. + ***************
  2502. + *** 51,58 ****
  2503. +       _CTR,        _CTR|_SP|_META,    _CTR|_NL|_META,    _CTR,
  2504. +   
  2505. +   /*     12 np         13 cr         14 so         15 si    */
  2506. + !     _CTR,        _CTR,        _CTR,        _CTR,
  2507. + ! 
  2508. +   /*     16 dle         17 dc1         18 dc2         19 dc3    */
  2509. +       _CTR,        _CTR,        _CTR,        _CTR,
  2510. +   
  2511. + --- 51,62 ----
  2512. +       _CTR,        _CTR|_SP|_META,    _CTR|_NL|_META,    _CTR,
  2513. +   
  2514. +   /*     12 np         13 cr         14 so         15 si    */
  2515. + ! #ifndef DOSTEXT
  2516. + !         _CTR,           _CTR,           _CTR,           _CTR,
  2517. + ! #else
  2518. + ! /* cr is whitespace */
  2519. + !         _CTR,           _CTR|_SP|_META, _CTR,           _CTR,
  2520. + ! #endif
  2521. +   /*     16 dle         17 dc1         18 dc2         19 dc3    */
  2522. +       _CTR,        _CTR,        _CTR,        _CTR,
  2523. +   
  2524. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,dir.c ./sh,dir.c
  2525. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,dir.c    Tue Nov 24 13:04:18 1992
  2526. + --- ./sh,dir.c    Thu Feb 25 05:31:40 1993
  2527. + ***************
  2528. + *** 242,248 ****
  2529. +       len = Strlen(hp);
  2530. +       if (!(dflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
  2531. +           Strncmp(hp, dp->di_name, len) == 0 &&
  2532. + !         (dp->di_name[len] == '\0' || dp->di_name[len] == '/')) 
  2533. +           len = Strlen(s = (dp->di_name + len)) + 2;
  2534. +       else
  2535. +           len = Strlen(s = dp->di_name) + 1;
  2536. + --- 242,248 ----
  2537. +       len = Strlen(hp);
  2538. +       if (!(dflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
  2539. +           Strncmp(hp, dp->di_name, len) == 0 &&
  2540. + !         (dp->di_name[len] == '\0' || is_dirsep(dp->di_name[len])) 
  2541. +           len = Strlen(s = (dp->di_name + len)) + 2;
  2542. +       else
  2543. +           len = Strlen(s = dp->di_name) + 1;
  2544. + ***************
  2545. + *** 301,308 ****
  2546. +   {
  2547. +   
  2548. +   /* return true if dp is of the form "../xxx" or "/../xxx" */
  2549. + ! #define IS_DOTDOT(sp, p) (ISDOTDOT(p) && ((p) == (sp) || *((p) - 1) == '/'))
  2550. + ! #define IS_DOT(sp, p) (ISDOT(p) && ((p) == (sp) || *((p) - 1) == '/'))
  2551. +   
  2552. +   #ifdef S_IFLNK
  2553. +       if (exp) {
  2554. + --- 301,308 ----
  2555. +   {
  2556. +   
  2557. +   /* return true if dp is of the form "../xxx" or "/../xxx" */
  2558. + ! #define IS_DOTDOT(sp, p) (ISDOTDOT(p) && ((p) == (sp) || is_dirsep(*((p) - 1))))
  2559. + ! #define IS_DOT(sp, p) (ISDOT(p) && ((p) == (sp) || is_dirsep(*((p) - 1))))
  2560. +   
  2561. +   #ifdef S_IFLNK
  2562. +       if (exp) {
  2563. + ***************
  2564. + *** 332,338 ****
  2565. +        * If the path starts with a slash, we are not relative to
  2566. +        * the current working directory.
  2567. +        */
  2568. + !     if ( *start == '/' )
  2569. +           *cwd = '\0';
  2570. +   # ifdef apollo
  2571. +       slashslash = cwd[0] == '/' && cwd[1] == '/';
  2572. + --- 332,338 ----
  2573. +        * If the path starts with a slash, we are not relative to
  2574. +        * the current working directory.
  2575. +        */
  2576. + !     if ( is_abspath(start) )
  2577. +           *cwd = '\0';
  2578. +   # ifdef apollo
  2579. +       slashslash = cwd[0] == '/' && cwd[1] == '/';
  2580. + ***************
  2581. + *** 363,369 ****
  2582. +   
  2583. +           *dp = '\0';
  2584. +           while (dotdot > 0) 
  2585. + !             if ((dp = Strrchr(cwd, '/')) != NULL) {
  2586. +   # ifdef apollo
  2587. +               if (dp == &cwd[1]) 
  2588. +                   slashslash = 1;
  2589. + --- 363,369 ----
  2590. +   
  2591. +           *dp = '\0';
  2592. +           while (dotdot > 0) 
  2593. + !             if ((dp = Lastslash(cwd)) != NULL) {
  2594. +   # ifdef apollo
  2595. +               if (dp == &cwd[1]) 
  2596. +                   slashslash = 1;
  2597. + ***************
  2598. + *** 391,403 ****
  2599. +   # endif /* apollo */
  2600. +   
  2601. +           if (buf[0]) {
  2602. + !             if ((TRM(cwd[(dotdot = Strlen(cwd)) - 1])) != '/')
  2603. +               cwd[dotdot++] = '/';
  2604. +               cwd[dotdot] = '\0';
  2605. + !             dp = Strspl(cwd, TRM(buf[0]) == '/' ? &buf[1] : buf);
  2606. +               xfree((ptr_t) cwd);
  2607. +               cwd = dp;
  2608. + !             if ((TRM(cwd[(dotdot = Strlen(cwd)) - 1])) == '/')
  2609. +               cwd[--dotdot] = '\0';
  2610. +           }
  2611. +           if (!*cp)
  2612. + --- 391,403 ----
  2613. +   # endif /* apollo */
  2614. +   
  2615. +           if (buf[0]) {
  2616. + !             if (! is_dirsep(TRM(cwd[(dotdot = Strlen(cwd)) - 1])))
  2617. +               cwd[dotdot++] = '/';
  2618. +               cwd[dotdot] = '\0';
  2619. + !             dp = Strspl(cwd, is_dirsep(TRM(buf[0])) ? &buf[1] : buf);
  2620. +               xfree((ptr_t) cwd);
  2621. +               cwd = dp;
  2622. + !             if (is_dirsep(TRM(cwd[(dotdot = Strlen(cwd)) - 1])))
  2623. +               cwd[--dotdot] = '\0';
  2624. +           }
  2625. +           if (!*cp)
  2626. + ***************
  2627. + *** 470,476 ****
  2628. +   {
  2629. +       Char   *dp;
  2630. +   
  2631. + !     if (*cp != '/') {
  2632. +       register Char *p, *q;
  2633. +       int     cwdlen;
  2634. +   
  2635. + --- 470,476 ----
  2636. +   {
  2637. +       Char   *dp;
  2638. +   
  2639. + !     if (! is_abspath(cp)) {
  2640. +       register Char *p, *q;
  2641. +       int     cwdlen;
  2642. +   
  2643. + ***************
  2644. + *** 547,553 ****
  2645. +       serrno = errno;
  2646. +       }
  2647. +   
  2648. + !     if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
  2649. +       && (c = adrof(STRcdpath))) {
  2650. +       Char  **cdp;
  2651. +       register Char *p;
  2652. + --- 547,553 ----
  2653. +       serrno = errno;
  2654. +       }
  2655. +   
  2656. + !     if (!is_abspath(cp) && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
  2657. +       && (c = adrof(STRcdpath))) {
  2658. +       Char  **cdp;
  2659. +       register Char *p;
  2660. + ***************
  2661. + *** 578,584 ****
  2662. +       }
  2663. +       }
  2664. +       dp = value(cp);
  2665. + !     if ((dp[0] == '/' || dp[0] == '.') && chdir(short2str(dp)) >= 0) {
  2666. +       xfree((ptr_t) cp);
  2667. +       cp = Strsave(dp);
  2668. +       printd = 1;
  2669. + --- 578,584 ----
  2670. +       }
  2671. +       }
  2672. +       dp = value(cp);
  2673. + !     if ((is_abspath(dp) || dp[0] == '.') && chdir(short2str(dp)) >= 0) {
  2674. +       xfree((ptr_t) cp);
  2675. +       cp = Strsave(dp);
  2676. +       printd = 1;
  2677. + ***************
  2678. + *** 801,811 ****
  2679. +        * christos: if the path given does not start with a slash prepend cwd. If
  2680. +        * cwd does not start with a slash or the result would be too long abort().
  2681. +        */
  2682. + !     if (*cp != '/') {
  2683. +       Char    tmpdir[MAXPATHLEN];
  2684. +   
  2685. +       p1 = value(STRcwd);
  2686. + !     if (p1 == STRNULL || *p1 != '/')
  2687. +           abort();
  2688. +       if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN)
  2689. +           abort();
  2690. + --- 801,811 ----
  2691. +        * christos: if the path given does not start with a slash prepend cwd. If
  2692. +        * cwd does not start with a slash or the result would be too long abort().
  2693. +        */
  2694. + !     if (! is_abspath(cp)) {
  2695. +       Char    tmpdir[MAXPATHLEN];
  2696. +   
  2697. +       p1 = value(STRcwd);
  2698. + !     if (p1 == STRNULL || !is_abspath(p1))
  2699. +           abort();
  2700. +       if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN)
  2701. +           abort();
  2702. + ***************
  2703. + *** 817,823 ****
  2704. +       }
  2705. +   
  2706. +   #ifdef COMMENT
  2707. + !     if (*cp != '/')
  2708. +       abort();
  2709. +   #endif /* COMMENT */
  2710. +   
  2711. + --- 817,823 ----
  2712. +       }
  2713. +   
  2714. +   #ifdef COMMENT
  2715. + !     if (!is_abspath(cp))
  2716. +       abort();
  2717. +   #endif /* COMMENT */
  2718. +   
  2719. + ***************
  2720. + *** 827,833 ****
  2721. +   
  2722. +       while (*p) {        /* for each component */
  2723. +       sp = p;            /* save slash address */
  2724. + !     while (*++p == '/')    /* flush extra slashes */
  2725. +           continue;
  2726. +       if (p != ++sp)
  2727. +           for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
  2728. + --- 827,833 ----
  2729. +   
  2730. +       while (*p) {        /* for each component */
  2731. +       sp = p;            /* save slash address */
  2732. + !     while (is_dirsep(*++p))    /* flush extra slashes */
  2733. +           continue;
  2734. +       if (p != ++sp)
  2735. +           for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
  2736. + ***************
  2737. + *** 835,841 ****
  2738. +       p = sp;            /* save start of component */
  2739. +       slash = 0;
  2740. +       while (*++p)        /* find next slash or end of path */
  2741. + !         if (*p == '/') {
  2742. +           slash = 1;
  2743. +           *p = 0;
  2744. +           break;
  2745. + --- 835,841 ----
  2746. +       p = sp;            /* save start of component */
  2747. +       slash = 0;
  2748. +       while (*++p)        /* find next slash or end of path */
  2749. + !         if (is_dirsep(*p)) {
  2750. +           slash = 1;
  2751. +           *p = 0;
  2752. +           break;
  2753. + ***************
  2754. + *** 885,896 ****
  2755. +            */
  2756. +           for (p1 = p; *p1++;)
  2757. +               continue;
  2758. + !         if (*link != '/') {
  2759. +               /*
  2760. +                * Relative path, expand it between the "yyy/" and the
  2761. +                * "/..". First, back sp up to the character past "yyy/".
  2762. +                */
  2763. + !             while (*--sp != '/')
  2764. +               continue;
  2765. +               sp++;
  2766. +               *sp = 0;
  2767. + --- 885,896 ----
  2768. +            */
  2769. +           for (p1 = p; *p1++;)
  2770. +               continue;
  2771. + !         if (! is_abspath(link)) {
  2772. +               /*
  2773. +                * Relative path, expand it between the "yyy/" and the
  2774. +                * "/..". First, back sp up to the character past "yyy/".
  2775. +                */
  2776. + !             while (!is_dirsep(*--sp))
  2777. +               continue;
  2778. +               sp++;
  2779. +               *sp = 0;
  2780. + ***************
  2781. + *** 942,948 ****
  2782. +   #endif /* S_IFLNK */
  2783. +           *sp = '/';
  2784. +           if (sp != cp)
  2785. + !         while (*--sp != '/')
  2786. +               continue;
  2787. +           if (slash) {
  2788. +           for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
  2789. + --- 942,948 ----
  2790. +   #endif /* S_IFLNK */
  2791. +           *sp = '/';
  2792. +           if (sp != cp)
  2793. + !         while (is_dirsep(*--sp))
  2794. +               continue;
  2795. +           if (slash) {
  2796. +           for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
  2797. + ***************
  2798. + *** 979,991 ****
  2799. +            */
  2800. +           for (p1 = p; *p1++;)
  2801. +               continue;
  2802. + !         if (*link != '/') {
  2803. +               /*
  2804. +                * Relative path, expand it between the "yyy/" and the
  2805. +                * remainder. First, back sp up to the character past
  2806. +                * "yyy/".
  2807. +                */
  2808. + !             while (*--sp != '/')
  2809. +               continue;
  2810. +               sp++;
  2811. +               *sp = 0;
  2812. + --- 979,991 ----
  2813. +            */
  2814. +           for (p1 = p; *p1++;)
  2815. +               continue;
  2816. + !         if (! is_abspath(link)) {
  2817. +               /*
  2818. +                * Relative path, expand it between the "yyy/" and the
  2819. +                * remainder. First, back sp up to the character past
  2820. +                * "yyy/".
  2821. +                */
  2822. + !             while (! is_dirsep(*--sp))
  2823. +               continue;
  2824. +               sp++;
  2825. +               *sp = 0;
  2826. + ***************
  2827. + *** 1049,1056 ****
  2828. +       /*
  2829. +        * See if we're not in a subdir of STRhome
  2830. +        */
  2831. + !     if (p1 && *p1 == '/' &&
  2832. + !     (Strncmp(p1, cp, cc) != 0 || (cp[cc] != '/' && cp[cc] != '\0'))) {
  2833. +       static ino_t home_ino = (ino_t) -1;
  2834. +       static dev_t home_dev = -1;
  2835. +       static Char *home_ptr = NULL;
  2836. + --- 1049,1056 ----
  2837. +       /*
  2838. +        * See if we're not in a subdir of STRhome
  2839. +        */
  2840. + !     if (p1 && is_abspath(p1) &&
  2841. + !     (Strncmp(p1, cp, cc) != 0 || (!is_dirsep(cp[cc]) && cp[cc] != '\0'))) {
  2842. +       static ino_t home_ino = (ino_t) -1;
  2843. +       static dev_t home_dev = -1;
  2844. +       static Char *home_ptr = NULL;
  2845. + ***************
  2846. + *** 1075,1081 ****
  2847. +               sp = (Char *) - 1;
  2848. +               break;
  2849. +           }
  2850. + !         if ((sp = Strrchr(p2, '/')) != NULL)
  2851. +           *sp = '\0';
  2852. +       }
  2853. +       /*
  2854. + --- 1075,1081 ----
  2855. +               sp = (Char *) - 1;
  2856. +               break;
  2857. +           }
  2858. + !         if ((sp = Lastslash(p2)) != NULL)
  2859. +           *sp = '\0';
  2860. +       }
  2861. +       /*
  2862. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,dol.c ./sh,dol.c
  2863. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,dol.c    Tue Nov 24 13:04:18 1992
  2864. + --- ./sh,dol.c    Thu Feb 25 05:37:04 1993
  2865. + ***************
  2866. + *** 480,485 ****
  2867. + --- 480,491 ----
  2868. +       if (length)
  2869. +           stderror(ERR_NOTALLOWED, "$%<");
  2870. +       for (np = wbuf; read(OLDSTD, &tnp, 1) == 1; np++) {
  2871. + + #ifdef DOSTEXT
  2872. + +             /* strip out cr's */
  2873. + +             while (tnp == '\r') {
  2874. + +                 if (read(OLDSTD, &tnp, 1) != 1) break;
  2875. + +             }
  2876. + + #endif
  2877. +           *np = (unsigned char) tnp;
  2878. +           if (np >= &wbuf[BUFSIZE - 1])
  2879. +           stderror(ERR_LTOOLONG);
  2880. + ***************
  2881. + *** 940,945 ****
  2882. + --- 946,961 ----
  2883. +       register Char *lbp, *obp, *mbp;
  2884. +       Char  **vp;
  2885. +       bool    quoted;
  2886. + + #ifdef __MINT__
  2887. + +     int tf;
  2888. + +     extern int csh_tmpfile __P((void));   /* in sh.c */
  2889. + + 
  2890. + +     tf = csh_tmpfile();
  2891. + +     if (tf < 0)
  2892. + +         stderror(ERR_SYSTEM, "tmpfile", strerror(errno));
  2893. + +     (void)dup2(tf, 0);
  2894. + +     (void)close(tf);
  2895. + + #else
  2896. +       char   *tmp;
  2897. +   
  2898. +       if (creat(tmp = short2str(shtemp), 0600) < 0)
  2899. + ***************
  2900. + *** 953,958 ****
  2901. + --- 969,976 ----
  2902. +       stderror(ERR_SYSTEM, tmp, strerror(errno));
  2903. +       }
  2904. +       (void) unlink(tmp);        /* 0 0 inode! */
  2905. + + #endif /* __MINT__ */
  2906. + + 
  2907. +       Dv[0] = term;
  2908. +       Dv[1] = NULL;
  2909. +       gflag = 0;
  2910. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,exec.c ./sh,exec.c
  2911. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,exec.c    Tue Nov 24 13:04:18 1992
  2912. + --- ./sh,exec.c    Fri Feb 26 01:23:20 1993
  2913. + ***************
  2914. + *** 49,54 ****
  2915. + --- 49,60 ----
  2916. +   # define FASTHASH    /* Fast hashing is the default */
  2917. +   #endif /* OLDHASH */
  2918. +   
  2919. + + #ifdef __MINT__
  2920. + + extern char **environ;
  2921. + + int     csh_execve      __P((char *, char **, char **));
  2922. + + #define execv(f, t) csh_execve(f, t, environ)
  2923. + + #endif
  2924. + + 
  2925. +   /*
  2926. +    * System level search and execute of a command.
  2927. +    * We look in each directory for the specified command name.
  2928. + ***************
  2929. + *** 180,190 ****
  2930. +   #endif /* VFORK */
  2931. +   
  2932. +       v = adrof(STRpath);
  2933. + !     if (v == 0 && expath[0] != '/') {
  2934. +       blkfree(pv);
  2935. +       pexerr();
  2936. +       }
  2937. + !     slash = any(short2str(expath), '/');
  2938. +   
  2939. +       /*
  2940. +        * Glob the argument list, if necessary. Otherwise trim off the quote bits.
  2941. + --- 186,196 ----
  2942. +   #endif /* VFORK */
  2943. +   
  2944. +       v = adrof(STRpath);
  2945. + !     if (v == 0 && !is_abspath(expath)) {
  2946. +       blkfree(pv);
  2947. +       pexerr();
  2948. +       }
  2949. + !     slash = hash_slash(short2str(expath));
  2950. +   
  2951. +       /*
  2952. +        * Glob the argument list, if necessary. Otherwise trim off the quote bits.
  2953. + ***************
  2954. + *** 266,272 ****
  2955. +        * one at a time, as the user enters them.  This is kinda like Korn
  2956. +        * Shell's "tracked aliases".
  2957. +        */
  2958. + !     if (!slash && pv[0][0] == '/' && havhash) {
  2959. +   #ifdef FASTHASH
  2960. +           if (!bit(hashval, i))
  2961. +           goto cont;
  2962. + --- 272,278 ----
  2963. +        * one at a time, as the user enters them.  This is kinda like Korn
  2964. +        * Shell's "tracked aliases".
  2965. +        */
  2966. + !     if (!slash && is_abspath(pv[0]) && havhash) {
  2967. +   #ifdef FASTHASH
  2968. +           if (!bit(hashval, i))
  2969. +           goto cont;
  2970. + ***************
  2971. + *** 421,427 ****
  2972. + --- 427,438 ----
  2973. +        */
  2974. +       if ((fd = open(f, O_RDONLY)) != -1) {
  2975. +           if (read(fd, (char *) pref, 2) == 2) {
  2976. + + #ifndef DOSTEXT
  2977. +           if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t')) {
  2978. + + #else
  2979. + +         if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t'
  2980. + +                                   && pref[0] != '\r')) {
  2981. + + #endif
  2982. +               (void) close(fd);
  2983. +               /*
  2984. +                * We *know* what ENOEXEC means.
  2985. + ***************
  2986. + *** 453,459 ****
  2987. + --- 464,472 ----
  2988. +   #ifdef _PATH_BSHELL
  2989. +           if (fd != -1 
  2990. +   # ifndef ISC    /* Compatible with ISC's /bin/csh */
  2991. + + #  ifndef __MINT__ /* Compensate for missing #! interpretation */
  2992. +               && pref[0] != '#'
  2993. + + #  endif
  2994. +   # endif /* ISC */
  2995. +               )
  2996. +               vp[0] = STR_BSHELL;
  2997. + ***************
  2998. + *** 637,642 ****
  2999. + --- 650,659 ----
  3000. +       struct varent *v = adrof(STRpath);
  3001. +       Char  **pv;
  3002. +       int hashval;
  3003. + + #ifdef __MINT__
  3004. + +     struct varent *suffv = adrof(STRsuffixes);
  3005. + +     Char **suffpv;
  3006. + + #endif
  3007. +   
  3008. +   #ifdef FASTHASH
  3009. +       if (vv && vv[1]) {
  3010. + ***************
  3011. + *** 677,683 ****
  3012. +       if (v == NULL)
  3013. +       return;
  3014. +       for (pv = v->vec; *pv; pv++, i++) {
  3015. + !     if (pv[0][0] != '/')
  3016. +           continue;
  3017. +       dirp = opendir(short2str(*pv));
  3018. +       if (dirp == NULL)
  3019. + --- 694,700 ----
  3020. +       if (v == NULL)
  3021. +       return;
  3022. +       for (pv = v->vec; *pv; pv++, i++) {
  3023. + !     if (! is_abspath(pv[0]))
  3024. +           continue;
  3025. +       dirp = opendir(short2str(*pv));
  3026. +       if (dirp == NULL)
  3027. + ***************
  3028. + *** 696,701 ****
  3029. + --- 713,731 ----
  3030. +           (dp->d_name[1] == '\0' ||
  3031. +            (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
  3032. +           continue;
  3033. + + #ifdef __MINT__
  3034. + +             {   char *s = rindex(dp->d_name, '.');
  3035. + + 
  3036. + +                 if (s && suffv) {
  3037. + +                     for (suffpv = suffv->vec; *suffpv; suffpv++) {
  3038. + +                         if (!strcmp(s+1, short2str(*suffpv))) {
  3039. + +                             *s = 0; break;
  3040. + +                         }
  3041. + +                     }
  3042. + +                 }
  3043. + +             }
  3044. + + #endif /* __MINT__ */
  3045. + + 
  3046. +   #ifdef FASTHASH
  3047. +           hashval = hashname(str2short(dp->d_name));
  3048. +           bis(hashval, i);
  3049. + ***************
  3050. + *** 769,775 ****
  3051. +       register Char **pv;
  3052. +       register Char *sav;
  3053. +       register struct varent *v;
  3054. + !     register bool slash = any(short2str(name), '/');
  3055. +       register int hashval, i;
  3056. +   
  3057. +       v = adrof(STRpath);
  3058. + --- 799,805 ----
  3059. +       register Char **pv;
  3060. +       register Char *sav;
  3061. +       register struct varent *v;
  3062. + !     register bool slash = has_slash(short2str(name));
  3063. +       register int hashval, i;
  3064. +   
  3065. +       v = adrof(STRpath);
  3066. + ***************
  3067. + *** 781,787 ****
  3068. +       hashval = havhash ? hashname(name) : 0;
  3069. +       i = 0;
  3070. +       do {
  3071. + !     if (!slash && pv[0][0] == '/' && havhash) {
  3072. +   #ifdef FASTHASH
  3073. +           if (!bit(hashval, i))
  3074. +           goto cont;
  3075. + --- 811,817 ----
  3076. +       hashval = havhash ? hashname(name) : 0;
  3077. +       i = 0;
  3078. +       do {
  3079. + !     if (!slash && is_abspath(pv[0]) && havhash) {
  3080. +   #ifdef FASTHASH
  3081. +           if (!bit(hashval, i))
  3082. +           goto cont;
  3083. + ***************
  3084. + *** 827,832 ****
  3085. + --- 857,915 ----
  3086. +    * if dir_ok is set and the pathname refers to a directory.
  3087. +    * This is a bit kludgy, but in the name of optimization...
  3088. +    */
  3089. + + #ifdef __MINT__
  3090. + + int
  3091. + + executable(dir, name, dir_ok)
  3092. + +     Char   *dir, *name;
  3093. + +     bool    dir_ok;
  3094. + + {
  3095. + +     char *ext, *base;
  3096. + +     int i;
  3097. + +     struct stat stbuf;
  3098. + +     Char    path[MAXPATHLEN + 1];
  3099. + +     char   *strname;
  3100. + +     struct varent *v;
  3101. + +     Char **pv;
  3102. + + 
  3103. + +     if (dir && *dir) {
  3104. + +         copyn(path, dir, MAXPATHLEN);
  3105. + +         catn(path, name, MAXPATHLEN);
  3106. + +         strname = short2str(path);
  3107. + +     }
  3108. + +     else
  3109. + +         strname = short2str(name);
  3110. + + 
  3111. + +     ext = base = alloca(strlen(strname) + 5);
  3112. + +     while (*strname)
  3113. + +         *ext++ = *strname++;
  3114. + + 
  3115. + +     *ext = 0;
  3116. + + 
  3117. + +     if (stat(base, &stbuf) != -1 &&
  3118. + +         ((dir_ok && S_ISDIR(stbuf.st_mode)) ||
  3119. + +           (S_ISREG(stbuf.st_mode) &&
  3120. + +           ((stbuf.st_mode & (S_IXOTH|S_IXGRP|S_IXUSR))))))
  3121. + +                 return 1;
  3122. + + 
  3123. + +     if (dir_ok) return 0;
  3124. + + 
  3125. + +     v = adrof(STRsuffixes);
  3126. + +     if (v == 0) return 0;
  3127. + + 
  3128. + +     *ext++ = '.';
  3129. + +     for (pv = v->vec; *pv; pv++) {
  3130. + +         strcpy(ext, short2str(*pv));
  3131. + +         if (stat(base, &stbuf) != -1 &&
  3132. + +             (S_ISREG(stbuf.st_mode) &&
  3133. + +              ((stbuf.st_mode & (S_IXOTH|S_IXGRP|S_IXUSR)) ||
  3134. + +               !strcmp(ext, "csh"))))
  3135. + +                return 1;
  3136. + +     }
  3137. + +     return 0;
  3138. + + }
  3139. + + 
  3140. + + #else /* __MINT__ */
  3141. + + 
  3142. +   int
  3143. +   executable(dir, name, dir_ok)
  3144. +       Char   *dir, *name;
  3145. + ***************
  3146. + *** 851,856 ****
  3147. + --- 934,940 ----
  3148. +             (stbuf.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)) &&
  3149. +             access(strname, X_OK) == 0)));
  3150. +   }
  3151. + + #endif /* __MINT__ */
  3152. +   
  3153. +   void
  3154. +   tellmewhat(lex)
  3155. + ***************
  3156. + *** 910,916 ****
  3157. +       if ((i = iscommand(strip(sp->word))) != 0) {
  3158. +       register Char **pv;
  3159. +       register struct varent *v;
  3160. + !     bool    slash = any(short2str(sp->word), '/');
  3161. +   
  3162. +       v = adrof(STRpath);
  3163. +       if (v == 0 || v->vec[0] == 0 || slash)
  3164. + --- 994,1000 ----
  3165. +       if ((i = iscommand(strip(sp->word))) != 0) {
  3166. +       register Char **pv;
  3167. +       register struct varent *v;
  3168. + !     bool    slash = has_slash(short2str(sp->word));
  3169. +   
  3170. +       v = adrof(STRpath);
  3171. +       if (v == 0 || v->vec[0] == 0 || slash)
  3172. + ***************
  3173. + *** 975,981 ****
  3174. +       Char *sv;
  3175. +       int hashval, i, ex, rval = 0;
  3176. +   
  3177. + !     if (prt && any(short2str(cmd), '/')) {
  3178. +       xprintf("where: / in command makes no sense\n");
  3179. +       return 0;
  3180. +       }
  3181. + --- 1059,1065 ----
  3182. +       Char *sv;
  3183. +       int hashval, i, ex, rval = 0;
  3184. +   
  3185. + !     if (prt && has_slash(short2str(cmd))) {
  3186. +       xprintf("where: / in command makes no sense\n");
  3187. +       return 0;
  3188. +       }
  3189. + ***************
  3190. + *** 1042,1044 ****
  3191. + --- 1126,1167 ----
  3192. +       xfree((ptr_t) sv);
  3193. +       return rval;
  3194. +   }
  3195. + + 
  3196. + + #ifdef __MINT__
  3197. + + 
  3198. + + #include <process.h>
  3199. + + 
  3200. + + int
  3201. + + csh_execve(path, argv, envp)
  3202. + +         char *path;
  3203. + +         char **argv, **envp;
  3204. + + {
  3205. + +         int i;
  3206. + +         char *newpath, *s;
  3207. + +         Char **pv;
  3208. + +         struct varent *v;
  3209. + + 
  3210. + +         newpath = s = alloca(strlen(path) + 5);
  3211. + +         while (*path) {
  3212. + +                 *s++ = *path++;
  3213. + +         }
  3214. + +         *s = 0;
  3215. + + 
  3216. + +         if (access(newpath, 0) == 0)
  3217. + +                 return _spawnve(P_OVERLAY, newpath, argv, envp);
  3218. + + 
  3219. + +         v = adrof(STRsuffixes);
  3220. + +         if (v == 0)
  3221. + +                 return -1;
  3222. + +         *s++ = '.';
  3223. + + 
  3224. + +         for (pv = v->vec; *pv; pv++) {
  3225. + +                 strcpy(s, short2str(*pv));
  3226. + +                 if (access(newpath, 0) == 0) {
  3227. + +                         return _spawnve(P_OVERLAY, newpath, argv, envp);
  3228. + +                 }
  3229. + +         }
  3230. + +         return -1;
  3231. + + }
  3232. + + #endif /* __MINT__ */
  3233. + + 
  3234. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,file.c ./sh,file.c
  3235. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,file.c    Tue Nov 24 13:04:18 1992
  3236. + --- ./sh,file.c    Fri Feb 26 01:26:22 1993
  3237. + ***************
  3238. + *** 407,413 ****
  3239. +       if (old[0] != '~')
  3240. +       return (Strcpy(new, old));
  3241. +   
  3242. + !     for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++);
  3243. +       *p = '\0';
  3244. +       if (person[0] == '\0')
  3245. +       (void) Strcpy(new, value(STRhome));
  3246. + --- 407,413 ----
  3247. +       if (old[0] != '~')
  3248. +       return (Strcpy(new, old));
  3249. +   
  3250. + !     for (p = person, o = &old[1]; *o && !is_dirsep(*o); *p++ = *o++);
  3251. +       *p = '\0';
  3252. +       if (person[0] == '\0')
  3253. +       (void) Strcpy(new, value(STRhome));
  3254. + ***************
  3255. + *** 502,508 ****
  3256. +   {
  3257. +       register Char *p;
  3258. +   
  3259. + !     p = Strrchr(path, '/');
  3260. +       if (p == NULL) {
  3261. +       copyn(name, path, MAXNAMLEN);
  3262. +       dir[0] = '\0';
  3263. + --- 502,508 ----
  3264. +   {
  3265. +       register Char *p;
  3266. +   
  3267. + !     p = Lastslash(path);
  3268. +       if (p == NULL) {
  3269. +       copyn(name, path, MAXNAMLEN);
  3270. +       dir[0] = '\0';
  3271. + ***************
  3272. + *** 590,596 ****
  3273. +       if (items != NULL)
  3274. +       FREE_ITEMS(items);
  3275. +   
  3276. + !     looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
  3277. +       if (looking_for_lognames) {
  3278. +   #ifndef _VMS_POSIX
  3279. +       (void) setpwent();
  3280. + --- 590,596 ----
  3281. +       if (items != NULL)
  3282. +       FREE_ITEMS(items);
  3283. +   
  3284. + !     looking_for_lognames = (*word == '~') && (Has_slash(word) == NULL);
  3285. +       if (looking_for_lognames) {
  3286. +   #ifndef _VMS_POSIX
  3287. +       (void) setpwent();
  3288. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,func.c ./sh,func.c
  3289. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,func.c    Tue Nov 24 13:04:20 1992
  3290. + --- ./sh,func.c    Fri Feb 26 01:32:22 1993
  3291. + ***************
  3292. + *** 66,71 ****
  3293. + --- 66,75 ----
  3294. +   static    void    toend        __P((void));
  3295. +   static    void    xecho        __P((int, Char **));
  3296. +   
  3297. + + #ifdef __MINT__
  3298. + + extern  void    importsuffixes  __P((Char *));  /* in sh.c */
  3299. + + #endif
  3300. + + 
  3301. +   struct biltins *
  3302. +   isbfunc(t)
  3303. +       struct command *t;
  3304. + ***************
  3305. + *** 276,282 ****
  3306. + --- 280,297 ----
  3307. +       islogin();
  3308. +       rechist(NULL);
  3309. +       (void) signal(SIGTERM, parterm);
  3310. + + #ifdef __MINT__
  3311. + +     {
  3312. + +         extern int csh_execve __P((char *, char **, char **)); /* in sh.exec.c */
  3313. + +         extern char **environ;
  3314. + +         char *args[3];
  3315. + + 
  3316. + +         args[0] = "login"; args[1] = short2str(v[1]); args[2] = NULL;
  3317. + +         (void)csh_execve(_PATH_LOGIN, args, environ);
  3318. + +     }
  3319. + + #else
  3320. +       (void) execl(_PATH_LOGIN, "login", short2str(v[1]), NULL);
  3321. + + #endif
  3322. +       untty();
  3323. +       xexit(1);
  3324. +   }
  3325. + ***************
  3326. + *** 1190,1195 ****
  3327. + --- 1205,1216 ----
  3328. +       importpath(lp);
  3329. +       dohash(NULL, NULL);
  3330. +       }
  3331. + + #ifdef __MINT__
  3332. + +     else if (eq(vp, STRSUFFIXES)) {
  3333. + +         importsuffixes(lp);
  3334. + +         dohash(NULL, NULL);
  3335. + +     }
  3336. + + #endif /* __MINT__ */
  3337. +   #ifdef apollo
  3338. +       else if (eq(vp, STRSYSTYPE))
  3339. +       dohash(NULL, NULL);
  3340. + ***************
  3341. + *** 1313,1318 ****
  3342. + --- 1334,1343 ----
  3343. +   
  3344. +           if (eq(name, STRNOREBIND))
  3345. +               NoNLSRebind = 0;
  3346. + + #ifdef __MINT__
  3347. + +                 else if (eq(name, STRSUFFIXES))
  3348. + +                     dohash(NULL, NULL);
  3349. + + #endif
  3350. +   #ifdef apollo
  3351. +           else if (eq(name, STRSYSTYPE))
  3352. +               dohash(NULL, NULL);
  3353. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,glob.c ./sh,glob.c
  3354. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,glob.c    Tue Nov 24 13:04:20 1992
  3355. + --- ./sh,glob.c    Fri Feb 26 01:40:46 1993
  3356. + ***************
  3357. + *** 97,103 ****
  3358. +       *gstart++ = *s++;
  3359. +       u = s;
  3360. +       for (b = gstart, e = &gbuf[BUFSIZE - 1]; 
  3361. + !      *s && *s != '/' && *s != ':' && b < e;
  3362. +        *b++ = *s++)
  3363. +       continue;
  3364. +       *b = EOS;
  3365. + --- 97,103 ----
  3366. +       *gstart++ = *s++;
  3367. +       u = s;
  3368. +       for (b = gstart, e = &gbuf[BUFSIZE - 1]; 
  3369. + !      *s && is_dirsep(*s) && *s != ':' && b < e;
  3370. +        *b++ = *s++)
  3371. +       continue;
  3372. +       *b = EOS;
  3373. + ***************
  3374. + *** 135,141 ****
  3375. +        * kfk - 17 Jan 1984 - stack hack allows user to get at arbitrary dir names
  3376. +        * in stack. PWP: let =foobar pass through (for X windows)
  3377. +        */
  3378. + !     if (old[1] == '-' && (old[2] == '\0' || old[2] == '/')) {
  3379. +       /* =- */
  3380. +       dig = -1;
  3381. +       b = &old[2];
  3382. + --- 135,141 ----
  3383. +        * kfk - 17 Jan 1984 - stack hack allows user to get at arbitrary dir names
  3384. +        * in stack. PWP: let =foobar pass through (for X windows)
  3385. +        */
  3386. + !     if (old[1] == '-' && (old[2] == '\0' || is_dirsep(old[2]))) {
  3387. +       /* =- */
  3388. +       dig = -1;
  3389. +       b = &old[2];
  3390. + ***************
  3391. + *** 145,151 ****
  3392. +       dig = old[1] - '0';
  3393. +       for (b = &old[2]; Isdigit(*b); b++)
  3394. +           dig = dig * 10 + (*b - '0');
  3395. + !     if (*b != '\0' && *b != '/')
  3396. +           /* =<number>foobar */
  3397. +           return old;
  3398. +       }
  3399. + --- 145,151 ----
  3400. +       dig = old[1] - '0';
  3401. +       for (b = &old[2]; Isdigit(*b); b++)
  3402. +           dig = dig * 10 + (*b - '0');
  3403. + !     if (*b != '\0' && !is_dirsep(*b))
  3404. +           /* =<number>foobar */
  3405. +           return old;
  3406. +       }
  3407. + ***************
  3408. + *** 674,680 ****
  3409. +           else if (isglob(*c))
  3410. +           gflag |= G_GLOB;
  3411. +           else if (symlinks == SYM_EXPAND && 
  3412. + !         *p && ISDOTDOT(c) && (c == *(t-1) || *(c-1) == '/') )
  3413. +               gflag |= G_CSH;
  3414. +       }
  3415. +       }
  3416. + --- 674,680 ----
  3417. +           else if (isglob(*c))
  3418. +           gflag |= G_GLOB;
  3419. +           else if (symlinks == SYM_EXPAND && 
  3420. + !         *p && ISDOTDOT(c) && (c == *(t-1) || is_dirsep(*(c-1))) )
  3421. +               gflag |= G_CSH;
  3422. +       }
  3423. +       }
  3424. + ***************
  3425. + *** 834,839 ****
  3426. + --- 834,855 ----
  3427. +           do
  3428. +               icnt = read(pvec[0], tibuf, BUFSIZE);
  3429. +           while (icnt == -1 && errno == EINTR);
  3430. + + #ifdef DOSTEXT
  3431. + +                 /* strip out carriage returns */
  3432. + +                 {
  3433. + +                         char *src, *dst;
  3434. + +                         int i;
  3435. + +                         src = dst = tibuf;
  3436. + + 
  3437. + +                         for (i = icnt; i > 0; --i) {
  3438. + +                                 if (*src == '\r')
  3439. + +                                         --icnt;
  3440. + +                                 else
  3441. + +                                         *dst++ = *src;
  3442. + +                                 src++;
  3443. + +                         }
  3444. + +                 }
  3445. + + #endif
  3446. +           if (icnt <= 0) {
  3447. +               c = -1;
  3448. +               break;
  3449. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,lex.c ./sh,lex.c
  3450. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,lex.c    Tue Nov 24 13:04:20 1992
  3451. + --- ./sh,lex.c    Fri Feb 26 02:05:56 1993
  3452. + ***************
  3453. + *** 430,436 ****
  3454. +       for (;;) {
  3455. +       if ((c = peekc) != 0) {
  3456. +           peekc = 0;
  3457. + !         return (c);
  3458. +       }
  3459. +       if (lap) {
  3460. +           if ((c = *lap++) == 0)
  3461. + --- 430,436 ----
  3462. +       for (;;) {
  3463. +       if ((c = peekc) != 0) {
  3464. +           peekc = 0;
  3465. + !         goto ret_c;
  3466. +       }
  3467. +       if (lap) {
  3468. +           if ((c = *lap++) == 0)
  3469. + ***************
  3470. + *** 438,453 ****
  3471. +           else {
  3472. +           if (cmap(c, _META | _Q | _Q1))
  3473. +               c |= QUOTE;
  3474. + !         return (c);
  3475. +           }
  3476. +       }
  3477. +       if ((c = peekd) != 0) {
  3478. +           peekd = 0;
  3479. + !         return (c);
  3480. +       }
  3481. +       if (exclp) {
  3482. +           if ((c = *exclp++) != 0)
  3483. + !         return (c);
  3484. +           if (exclnxt && --exclc >= 0) {
  3485. +           exclnxt = exclnxt->next;
  3486. +           setexclp(exclnxt->word);
  3487. + --- 438,453 ----
  3488. +           else {
  3489. +           if (cmap(c, _META | _Q | _Q1))
  3490. +               c |= QUOTE;
  3491. + !         goto ret_c;
  3492. +           }
  3493. +       }
  3494. +       if ((c = peekd) != 0) {
  3495. +           peekd = 0;
  3496. + !         goto ret_c;
  3497. +       }
  3498. +       if (exclp) {
  3499. +           if ((c = *exclp++) != 0)
  3500. + !         goto ret_c;
  3501. +           if (exclnxt && --exclc >= 0) {
  3502. +           exclnxt = exclnxt->next;
  3503. +           setexclp(exclnxt->word);
  3504. + ***************
  3505. + *** 475,481 ****
  3506. + --- 475,486 ----
  3507. +       }
  3508. +       break;
  3509. +       }
  3510. + + ret_c:
  3511. + + #ifdef DOSTEXT
  3512. + +     return (c == '\r' ? getC1(flag) : c);
  3513. + + #else
  3514. +       return (c);
  3515. + + #endif
  3516. +   }
  3517. +   
  3518. +   static void
  3519. + ***************
  3520. + *** 1125,1134 ****
  3521. +   
  3522. +       case 'h':
  3523. +       case 't':
  3524. + !     if (!any(short2str(cp), '/'))
  3525. +           return (type == 't' ? Strsave(cp) : 0);
  3526. +       wp = Strend(cp);
  3527. + !     while (*--wp != '/')
  3528. +           continue;
  3529. +       if (type == 'h')
  3530. +           xp = Strsave(cp), xp[wp - cp] = 0;
  3531. + --- 1130,1139 ----
  3532. +   
  3533. +       case 'h':
  3534. +       case 't':
  3535. + !     if (!has_slash(short2str(cp)))
  3536. +           return (type == 't' ? Strsave(cp) : 0);
  3537. +       wp = Strend(cp);
  3538. + !     while (!is_dirsep(*--wp))
  3539. +           continue;
  3540. +       if (type == 'h')
  3541. +           xp = Strsave(cp), xp[wp - cp] = 0;
  3542. + ***************
  3543. + *** 1139,1145 ****
  3544. +       case 'e':
  3545. +       case 'r':
  3546. +       wp = Strend(cp);
  3547. + !     for (wp--; wp >= cp && *wp != '/'; wp--)
  3548. +           if (*wp == '.') {
  3549. +           if (type == 'e')
  3550. +               xp = Strsave(wp + 1);
  3551. + --- 1144,1150 ----
  3552. +       case 'e':
  3553. +       case 'r':
  3554. +       wp = Strend(cp);
  3555. + !     for (wp--; wp >= cp && !is_dirsep(*wp); wp--)
  3556. +           if (*wp == '.') {
  3557. +           if (type == 'e')
  3558. +               xp = Strsave(wp + 1);
  3559. + ***************
  3560. + *** 1622,1628 ****
  3561. +       }
  3562. +       c = fbuf[0][fseekp - fbobp];
  3563. +       fseekp++;
  3564. + !     return (c);
  3565. +       }
  3566. +   again:
  3567. +       buf = (int) fseekp / BUFSIZE;
  3568. + --- 1627,1633 ----
  3569. +       }
  3570. +       c = fbuf[0][fseekp - fbobp];
  3571. +       fseekp++;
  3572. + !     goto ret_c;
  3573. +       }
  3574. +   again:
  3575. +       buf = (int) fseekp / BUFSIZE;
  3576. + ***************
  3577. + *** 1699,1705 ****
  3578. + --- 1704,1716 ----
  3579. +       }
  3580. +       c = fbuf[buf][(int) fseekp % BUFSIZE];
  3581. +       fseekp++;
  3582. + + 
  3583. + + ret_c:
  3584. + + #ifdef DOSTEXT
  3585. + +     return (c == '\r' ? bgetc() : c);
  3586. + + #else
  3587. +       return (c);
  3588. + + #endif
  3589. +   }
  3590. +   
  3591. +   static void
  3592. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,misc.c ./sh,misc.c
  3593. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,misc.c    Tue Nov 24 13:04:20 1992
  3594. + --- ./sh,misc.c    Fri Feb 26 02:14:42 1993
  3595. + ***************
  3596. + *** 38,43 ****
  3597. + --- 38,47 ----
  3598. +   
  3599. +   RCSID("$Id: sh.misc.c,v 3.17 1992/10/18 00:43:08 christos Exp $")
  3600. +   
  3601. + + #ifdef __MINT__
  3602. + + extern int __mint;      /* kernel version */
  3603. + + #endif
  3604. + + 
  3605. +   static    int    renum    __P((int, int));
  3606. +   static  Char  **blkend    __P((Char **));
  3607. +   static  Char  **blkcat    __P((Char **, Char **));
  3608. + ***************
  3609. + *** 270,275 ****
  3610. + --- 274,285 ----
  3611. +   {
  3612. +       register int f;
  3613. +   
  3614. + + #ifdef __MINT__
  3615. + + /* in TOS, all handles are shared by all processes! (ack!) */
  3616. + +     if (__mint == 0)
  3617. + +         return;
  3618. + + #endif
  3619. + + 
  3620. +       if (didcch)
  3621. +       return;
  3622. +       didcch = 1;
  3623. + ***************
  3624. + *** 308,313 ****
  3625. + --- 318,326 ----
  3626. +       if (i == j || i < 0)
  3627. +       return (i);
  3628. +   #ifdef HAVEDUP2
  3629. + + # ifdef __MINT__
  3630. + +     if (__mint != 0)    /* TOS screws up dup2 */
  3631. + + # endif
  3632. +       if (j >= 0) {
  3633. +       (void) dup2(i, j);
  3634. +       if (j != i)
  3635. + ***************
  3636. + *** 328,333 ****
  3637. + --- 341,351 ----
  3638. +   
  3639. +       if (i == j || i < 0 || (j < 0 && i > 2))
  3640. +       return (i);
  3641. + + #ifdef __MINT__
  3642. + +     if (__mint == 0 && j > 5) {
  3643. + +         return (i <= 5) ? dup(i) : j;
  3644. + +     }
  3645. + + #endif
  3646. +       if (j >= 0) {
  3647. +   #ifdef HAVEDUP2
  3648. +       (void) dup2(i, j);
  3649. + ***************
  3650. + *** 464,466 ****
  3651. + --- 482,567 ----
  3652. +           return (0);
  3653. +       }
  3654. +   }
  3655. + + 
  3656. + + #ifdef DOSFS
  3657. + + 
  3658. + + int
  3659. + + is_dirsep(i)
  3660. + +         int i;
  3661. + + {
  3662. + +         return i == '/' || i == '\\' ;
  3663. + + }
  3664. + + 
  3665. + + int
  3666. + + is_abspath(pth)
  3667. + +         register Char *pth;
  3668. + + {
  3669. + +         return is_dirsep(TRM(*pth)) || TRM(pth[1]) == ':';
  3670. + + }
  3671. + + 
  3672. + + char *
  3673. + + lastslash(pth)
  3674. + +         register char *pth;
  3675. + + {
  3676. + +         register char *slash = 0, *s = pth, c;
  3677. + + 
  3678. + +         if (! s) return 0;
  3679. + + 
  3680. + +         while ( (c = *s++) != 0) {
  3681. + +                 if (is_dirsep(c))
  3682. + +                         slash = s - 1;
  3683. + +         }
  3684. + +         if (slash)
  3685. + +                 return slash;
  3686. + +         return (pth[1] == ':') ? pth : 0;
  3687. + + }
  3688. + + 
  3689. + + Char *
  3690. + + Lastslash(pth)
  3691. + +         register Char *pth;
  3692. + + {
  3693. + +         register Char *slash = 0, *s = pth, c;
  3694. + + 
  3695. + +         if (! s) return 0;
  3696. + + 
  3697. + +         while ( (c = *s++) != 0) {
  3698. + +                 if (is_dirsep(c))
  3699. + +                         slash = s - 1;
  3700. + +         }
  3701. + +         if (slash)
  3702. + +                 return slash;
  3703. + +         return (pth[1] == ':') ? pth : 0;
  3704. + + }
  3705. + + 
  3706. + + int
  3707. + + hasslash(pth)
  3708. + +         register char *pth;
  3709. + + {
  3710. + +         register char c;
  3711. + + 
  3712. + +         if (! pth) return 0;
  3713. + + 
  3714. + +         while ( (c = *pth++) != 0)
  3715. + +                 if (is_dirsep(c))
  3716. + +                         return 1;
  3717. + + 
  3718. + +         return 0;
  3719. + + }
  3720. + + 
  3721. + + int
  3722. + + Hasslash(pth)
  3723. + +         register Char *pth;
  3724. + + {
  3725. + +         register Char c;
  3726. + + 
  3727. + +         if (! pth) return 0;
  3728. + + 
  3729. + +         while ( (c = *pth++) != 0)
  3730. + +                 if (is_dirsep(c))
  3731. + +                         return 1;
  3732. + + 
  3733. + +         return 0;
  3734. + + }
  3735. + + 
  3736. + + #endif /* DOSFS */
  3737. + + 
  3738. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,proc.c ./sh,proc.c
  3739. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,proc.c    Tue Nov 24 13:04:22 1992
  3740. + --- ./sh,proc.c    Fri Feb 26 02:23:04 1993
  3741. + ***************
  3742. + *** 83,94 ****
  3743. +                   0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
  3744. +   
  3745. +   # else /* !SUNOS4 && !hp9000 */
  3746. + ! #  ifdef masscomp
  3747. +   /*
  3748. +    * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic
  3749. +    * because the first two elements are unions of a time_t and a struct timeval.
  3750. +    * So we'll just have to trust the loader to do the "right thing", DAS DEC-90.
  3751. +    */
  3752. +   static struct rusage zru;
  3753. +   #  else    /* masscomp */
  3754. +   static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, 
  3755. + --- 83,97 ----
  3756. +                   0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
  3757. +   
  3758. +   # else /* !SUNOS4 && !hp9000 */
  3759. + ! #  if defined(masscomp) || defined(__MINT__)
  3760. +   /*
  3761. +    * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic
  3762. +    * because the first two elements are unions of a time_t and a struct timeval.
  3763. +    * So we'll just have to trust the loader to do the "right thing", DAS DEC-90.
  3764. +    */
  3765. + + /* MiNT is missing a lot of fields, so we also trust the loader (we can
  3766. + +  * trust it) to avoid getting errors from the compiler
  3767. + +  */
  3768. +   static struct rusage zru;
  3769. +   #  else    /* masscomp */
  3770. +   static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, 
  3771. + ***************
  3772. + *** 119,124 ****
  3773. + --- 122,145 ----
  3774. +   static    struct process    *pgetcurr    __P((struct process *));
  3775. +   static    void         okpcntl    __P((void));
  3776. +   
  3777. + + #ifdef __MINT__
  3778. + + /*
  3779. + +  * MiNT's fork() is a lot like vfork() in some respects; in particular,
  3780. + +  * if we set job control signals to SIG_DFL after fork() and then
  3781. + +  * get a signal, our parent will never be able to reclaim the address
  3782. + +  * space and everything will hang :-(. Solution: rather than SIG_DFL,
  3783. + +  * set the signals to a null signal handler; if we exec(), they will
  3784. + +  * be set to SIG_DFL automatically, and before then the signals will
  3785. + +  * effectively be ignored.
  3786. + +  */
  3787. + + 
  3788. + + void
  3789. + + sig_tmp_ign(int sig)
  3790. + + {
  3791. + + /* do nothing, and rely on the magic of restartable system calls :-) */
  3792. + + }
  3793. + + #endif
  3794. + + 
  3795. +   /*
  3796. +    * pchild - called at interrupt level by the SIGCHLD signal
  3797. +    *    indicating that at least one child has terminated or stopped
  3798. + ***************
  3799. + *** 1856,1865 ****
  3800. + --- 1877,1893 ----
  3801. +           (void) signal(SIGQUIT, ignint ? SIG_IGN : SIG_DFL);
  3802. +   #ifdef BSDJOBS
  3803. +           if (wanttty >= 0) {
  3804. + + # ifdef __MINT__
  3805. + + /* see comments for sig_tmp_ign above */
  3806. + +                 (void) signal(SIGTSTP, sig_tmp_ign);
  3807. + +                 (void) signal(SIGTTIN, sig_tmp_ign);
  3808. + +                 (void) signal(SIGTTOU, sig_tmp_ign);
  3809. + + # else
  3810. +           /* make stoppable */
  3811. +           (void) signal(SIGTSTP, SIG_DFL);
  3812. +           (void) signal(SIGTTIN, SIG_DFL);
  3813. +           (void) signal(SIGTTOU, SIG_DFL);
  3814. + + # endif
  3815. +           }
  3816. +   #endif /* BSDJOBS */
  3817. +           (void) signal(SIGTERM, parterm);
  3818. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,sem.c ./sh,sem.c
  3819. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,sem.c    Tue Nov 24 13:04:22 1992
  3820. + --- ./sh,sem.c    Fri Feb 26 02:36:24 1993
  3821. + ***************
  3822. + *** 489,497 ****
  3823. + --- 489,506 ----
  3824. +               }
  3825. +   # ifdef BSDJOBS
  3826. +               if (_gv.wanttty >= 0) {
  3827. + + #  ifdef __MINT__
  3828. + + /* see sh.proc.c */
  3829. + +                             extern void sig_tmp_ign();
  3830. + + 
  3831. + +                             (void) signal(SIGTSTP, sig_tmp_ign);
  3832. + +                             (void) signal(SIGTTIN, sig_tmp_ign);
  3833. + +                             (void) signal(SIGTTOU, sig_tmp_ign);
  3834. + + #  else
  3835. +                   (void) signal(SIGTSTP, SIG_DFL);
  3836. +                   (void) signal(SIGTTIN, SIG_DFL);
  3837. +                   (void) signal(SIGTTOU, SIG_DFL);
  3838. + + #  endif
  3839. +               }
  3840. +   # endif /* BSDJOBS */
  3841. +   
  3842. + ***************
  3843. + *** 612,619 ****
  3844. + --- 621,630 ----
  3845. +       execute(t->t_dcdr, _gv.wanttty, pv, pipeout);
  3846. +       t->t_dcar->t_dflg |= F_PIPEOUT |
  3847. +           (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT));
  3848. + + # ifndef __MINT__
  3849. +       if (_gv.wanttty > 0)
  3850. +           _gv.wanttty = 0;    /* got tty already */
  3851. + + # endif
  3852. +       execute(t->t_dcar, _gv.wanttty, pipein, pv);
  3853. +   #else /* !BACKPIPE */
  3854. +       t->t_dcar->t_dflg |= F_PIPEOUT |
  3855. + ***************
  3856. + *** 621,628 ****
  3857. + --- 632,641 ----
  3858. +       execute(t->t_dcar, _gv.wanttty, pipein, pv);
  3859. +       t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg &
  3860. +               (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT));
  3861. + + # ifndef __MINT__
  3862. +       if (_gv.wanttty > 0)
  3863. +           _gv.wanttty = 0;    /* got tty already */
  3864. + + # endif
  3865. +       execute(t->t_dcdr, _gv.wanttty, pv, pipeout);
  3866. +   #endif /* BACKPIPE */
  3867. +       break;
  3868. + ***************
  3869. + *** 795,812 ****
  3870. + --- 808,839 ----
  3871. +           (void) dmove(fd, 0);
  3872. +       }
  3873. +       else if (flags & F_PIPEIN) {
  3874. + + #ifdef __MINT__
  3875. + +             (void) dup2(pipein[0], 0);
  3876. + + #else
  3877. +           (void) close(0);
  3878. +           (void) dup(pipein[0]);
  3879. + + #endif
  3880. +           (void) close(pipein[0]);
  3881. +           (void) close(pipein[1]);
  3882. +       }
  3883. +       else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
  3884. + + #ifdef __MINT__
  3885. + +             int fd = open(_PATH_DEVNULL, O_RDONLY);
  3886. + +             (void) dup2(fd, 0);
  3887. + +             (void) close(fd);
  3888. + + #else
  3889. +           (void) close(0);
  3890. +           (void) open(_PATH_DEVNULL, O_RDONLY);
  3891. + + #endif
  3892. +       }
  3893. +       else {
  3894. + + #ifdef __MINT__
  3895. + +             (void) dup2(OLDSTD, 0);
  3896. + + #else
  3897. +           (void) close(0);
  3898. +           (void) dup(OLDSTD);
  3899. + + #endif
  3900. +   #if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  3901. +           /*
  3902. +            * PWP: Unlike Bezerkeley 4.3, FIONCLEX for Pyramid is preserved
  3903. + ***************
  3904. + *** 853,865 ****
  3905. + --- 880,900 ----
  3906. +       is1atty = isatty(1);
  3907. +       }
  3908. +       else if (flags & F_PIPEOUT) {
  3909. + + #ifdef __MINT__
  3910. + +         (void) dup2(pipeout[1], 1);
  3911. + + #else
  3912. +       (void) close(1);
  3913. +       (void) dup(pipeout[1]);
  3914. + + #endif
  3915. +       is1atty = 0;
  3916. +       }
  3917. +       else {
  3918. + + #ifdef __MINT__
  3919. + +         (void) dup2(SHOUT, 1);
  3920. + + #else
  3921. +       (void) close(1);
  3922. +       (void) dup(SHOUT);
  3923. + + #endif
  3924. +       is1atty = isoutatty;
  3925. +   # if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  3926. +       (void) close_on_exec(1, 0);
  3927. + ***************
  3928. + *** 868,878 ****
  3929. + --- 903,921 ----
  3930. +   
  3931. +       (void) close(2);
  3932. +       if (flags & F_STDERR) {
  3933. + + #ifdef __MINT__
  3934. + +         (void) dup2(1, 2);
  3935. + + #else
  3936. +       (void) dup(1);
  3937. + + #endif
  3938. +       is2atty = is1atty;
  3939. +       }
  3940. +       else {
  3941. + + #ifdef __MINT__
  3942. + +         (void) dup2(SHDIAG, 2);
  3943. + + #else
  3944. +       (void) dup(SHDIAG);
  3945. + + #endif
  3946. +       is2atty = isdiagatty;
  3947. +   # if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
  3948. +       (void) close_on_exec(2, 0);
  3949. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,set.c ./sh,set.c
  3950. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,set.c    Tue Nov 24 13:04:22 1992
  3951. + --- ./sh,set.c    Fri Feb 26 02:42:28 1993
  3952. + ***************
  3953. + *** 54,59 ****
  3954. + --- 54,62 ----
  3955. +   static    struct varent    *madrof        __P((Char *, struct varent *));
  3956. +   static    void         unsetv1    __P((struct varent *));
  3957. +   static    void         exportpath    __P((Char **));
  3958. + + #ifdef __MINT__
  3959. + + static  void             exportsuffixes __P((Char **));
  3960. + + #endif
  3961. +   static    void         balance    __P((struct varent *, int, int));
  3962. +   
  3963. +   /*
  3964. + ***************
  3965. + *** 68,73 ****
  3966. + --- 71,82 ----
  3967. +       exportpath(adrof(STRpath)->vec);
  3968. +       dohash(NULL, NULL);
  3969. +       }
  3970. + + #ifdef __MINT__
  3971. + +     else if (eq(vp, STRsuffixes)) {
  3972. + +         exportsuffixes(adrof(STRsuffixes)->vec);
  3973. + +         dohash(NULL, NULL);
  3974. + +     }
  3975. + + #endif
  3976. +       else if (eq(vp, STRhistchars)) {
  3977. +       register Char *pn = value(vp);
  3978. +   
  3979. + ***************
  3980. + *** 418,424 ****
  3981. +       }
  3982. +       else {
  3983. +       num = 4;        /* confuse lint */
  3984. + !     if (sizeof(int) == num && ((unsigned int) n) == 2147483648) {
  3985. +           *putp++ = '2';
  3986. +           n = 147483648;
  3987. +       }
  3988. + --- 427,433 ----
  3989. +       }
  3990. +       else {
  3991. +       num = 4;        /* confuse lint */
  3992. + !     if (sizeof(int) == num && ((unsigned int) n) == 2147483648U) {
  3993. +           *putp++ = '2';
  3994. +           n = 147483648;
  3995. +       }
  3996. + ***************
  3997. + *** 730,735 ****
  3998. + --- 739,768 ----
  3999. +       }
  4000. +       tsetenv(STRKPATH, exppath);
  4001. +   }
  4002. + + 
  4003. + + #ifdef __MINT__
  4004. + + static void
  4005. + + exportsuffixes(val)
  4006. + +     Char  **val;
  4007. + + {
  4008. + +     Char    expsuff[BUFSIZE];
  4009. + +     static Char STRcomma[] = { ',' , '\0' };
  4010. + + 
  4011. + +     expsuff[0] = 0;
  4012. + +     if (val)
  4013. + +         while (*val) {
  4014. + +             if (Strlen(*val) + Strlen(expsuff) + 2 > BUFSIZE) {
  4015. + +                 xprintf("Warning: ridiculously long SUFFIXES truncated\n");
  4016. + +                 break;
  4017. + +             }
  4018. + +             (void) Strcat(expsuff, *val++);
  4019. + +             if (*val == 0 || eq(*val, STRRparen))
  4020. + +                 break;
  4021. + +             (void) Strcat(expsuff, STRcomma);
  4022. + +         }
  4023. + +     Setenv(STRSUFFIXES, expsuff);
  4024. + + }
  4025. + + #endif /* __MINT__ */
  4026. +   
  4027. +   #ifndef lint
  4028. +    /*
  4029. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,time.c ./sh,time.c
  4030. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,time.c    Tue Nov 24 13:04:22 1992
  4031. + --- ./sh,time.c    Fri Feb 26 02:46:54 1993
  4032. + ***************
  4033. + *** 178,183 ****
  4034. + --- 178,184 ----
  4035. +   {
  4036. +       tvadd(&ru->ru_utime, &ru2->ru_utime);
  4037. +       tvadd(&ru->ru_stime, &ru2->ru_stime);
  4038. + + #ifndef __MINT__
  4039. +       if (ru2->ru_maxrss > ru->ru_maxrss)
  4040. +       ru->ru_maxrss = ru2->ru_maxrss;
  4041. +   
  4042. + ***************
  4043. + *** 194,199 ****
  4044. + --- 195,201 ----
  4045. +       ru->ru_nsignals += ru2->ru_nsignals;
  4046. +       ru->ru_nvcsw += ru2->ru_nvcsw;
  4047. +       ru->ru_nivcsw += ru2->ru_nivcsw;
  4048. + + #endif
  4049. +   }
  4050. +   
  4051. +   #else /* BSDTIMES */
  4052. + ***************
  4053. + *** 325,331 ****
  4054. + --- 327,337 ----
  4055. +       int     ms =
  4056. +       (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
  4057. +   
  4058. + + # ifdef __MINT__
  4059. + +     cp = "%Uu %Ss %E %P";
  4060. + + # else
  4061. +       cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww";
  4062. + + # endif
  4063. +   #else
  4064. +   # ifdef _SEQUENT_
  4065. +       int     ms =
  4066. + ***************
  4067. + *** 416,422 ****
  4068. +           xprintf("%ld.%01ld%%", i / 10, i % 10);    /* nn.n% */
  4069. +           break;
  4070. +   
  4071. + ! #ifdef BSDTIMES
  4072. +           case 'W':        /* number of swaps */
  4073. +           i = r1->ru_nswap - r0->ru_nswap;
  4074. +           xprintf("%ld", i);
  4075. + --- 422,428 ----
  4076. +           xprintf("%ld.%01ld%%", i / 10, i % 10);    /* nn.n% */
  4077. +           break;
  4078. +   
  4079. + ! #if defined(BSDTIMES) && !defined(__MINT__)
  4080. +           case 'W':        /* number of swaps */
  4081. +           i = r1->ru_nswap - r0->ru_nswap;
  4082. +           xprintf("%ld", i);
  4083. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,types.h ./sh,types.h
  4084. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh,types.h    Tue Nov 24 13:04:34 1992
  4085. + --- ./sh,types.h    Fri Feb 26 02:48:12 1993
  4086. + ***************
  4087. + *** 447,452 ****
  4088. + --- 447,460 ----
  4089. +   #endif /* convex */
  4090. +   
  4091. +   /*
  4092. + +  * MiNT
  4093. + +  */
  4094. + + #ifdef __MINT__
  4095. + + # define _SIGMASK_T
  4096. + + typedef long sigmask_t;
  4097. + + #endif
  4098. + + 
  4099. + + /*
  4100. +    * Alliant FX-2800/FX-80
  4101. +    */
  4102. +   #ifdef alliant
  4103. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh.c ./sh.c
  4104. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh.c    Tue Nov 24 13:04:16 1992
  4105. + --- ./sh.c    Sun Mar  7 17:43:04 1993
  4106. + ***************
  4107. + *** 118,123 ****
  4108. + --- 118,128 ----
  4109. +   static    void          mailchk    __P((void));
  4110. +   static    Char         **defaultpath    __P((void));
  4111. +   
  4112. + + #ifdef __MINT__
  4113. + + static  Char            **defaultsuffixes __P((void));
  4114. + + void    importsuffixes  __P((Char *));
  4115. + + #endif
  4116. + + 
  4117. +   int
  4118. +   main(argc, argv)
  4119. +       int     argc;
  4120. + ***************
  4121. + *** 229,234 ****
  4122. + --- 234,249 ----
  4123. +       loginsh = (argc == 1 && getppid() == 1);
  4124. +   #endif /* _VMS_POSIX */
  4125. +   
  4126. + + #ifdef __MINT__
  4127. + +     /* under MiNT, we're also a login shell if we ran from the desktop and
  4128. + +      * have no arguments
  4129. + +      */
  4130. + +     if (!loginsh && tempv[0][0] == 0 && !tempv[1]) {
  4131. + +         loginsh = 1;
  4132. + +         tempv[0] = "-tcsh";
  4133. + +     }
  4134. + + #endif
  4135. + + 
  4136. +       if (loginsh && **tempv != '-') {
  4137. +       /*
  4138. +        * Mangle the argv space
  4139. + ***************
  4140. + *** 373,379 ****
  4141. +       if (loginsh || (uid == 0)) {
  4142. +       if (*cp) {
  4143. +           /* only for login shells or root and we must have a tty */
  4144. + !         if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
  4145. +           cp = cp2 + 1;
  4146. +           }
  4147. +           if (!((Strncmp(cp, STRtty, 3) == 0) &&
  4148. + --- 388,394 ----
  4149. +       if (loginsh || (uid == 0)) {
  4150. +       if (*cp) {
  4151. +           /* only for login shells or root and we must have a tty */
  4152. + !         if ((cp2 = Lastslash(cp)) != NULL) {
  4153. +           cp = cp2 + 1;
  4154. +           }
  4155. +           if (!((Strncmp(cp, STRtty, 3) == 0) &&
  4156. + ***************
  4157. + *** 535,540 ****
  4158. + --- 550,564 ----
  4159. +        */
  4160. +       importpath(str2short(tcp));
  4161. +   
  4162. + + #ifdef __MINT__
  4163. + +     /*
  4164. + +      * set the suffix search list
  4165. + +      */
  4166. + +     if ((tcp = getenv("SUFFIXES")) == NULL)
  4167. + +         set1(STRsuffixes, defaultsuffixes(), &shvhed);
  4168. + +     else
  4169. + +         importsuffixes(SAVE(tcp));
  4170. + + #endif
  4171. +   
  4172. +       {
  4173. +       /* If the SHELL environment variable ends with "tcsh", set
  4174. + ***************
  4175. + *** 769,774 ****
  4176. + --- 793,808 ----
  4177. +        */
  4178. +       if (nofile == 0 && argc > 0) {
  4179. +       nofile = open(tempv[0], O_RDONLY);
  4180. + + #ifdef __MINT__
  4181. + +         /* maybe the user tried to execute "foo.csh" as just "foo"
  4182. + +          */
  4183. + +         if (nofile < 0) {
  4184. + +             char *cshfile = alloca(strlen(tempv[0]) + 5);
  4185. + +             strcpy(cshfile, tempv[0]);
  4186. + +             strcat(cshfile, ".csh");
  4187. + +             nofile = open(cshfile, O_RDONLY);
  4188. + +         }
  4189. + + #endif
  4190. +       if (nofile < 0) {
  4191. +           child = 1;        /* So this ... */
  4192. +           /* ... doesn't return */
  4193. + ***************
  4194. + *** 1165,1171 ****
  4195. +   srccat(cp, dp)
  4196. +       Char   *cp, *dp;
  4197. +   {
  4198. + !     if (cp[0] == '/' && cp[1] == '\0') 
  4199. +       return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
  4200. +       else {
  4201. +       register Char *ep = Strspl(cp, dp);
  4202. + --- 1199,1205 ----
  4203. +   srccat(cp, dp)
  4204. +       Char   *cp, *dp;
  4205. +   {
  4206. + !     if (is_dirsep(cp[0]) && cp[1] == '\0') 
  4207. +       return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
  4208. +       else {
  4209. +       register Char *ep = Strspl(cp, dp);
  4210. + ***************
  4211. + *** 1952,1957 ****
  4212. + --- 1986,1995 ----
  4213. +   #endif
  4214. +       int     i;
  4215. +   {
  4216. + + #ifdef __MINT__
  4217. + +     void rm_tmpfiles();
  4218. + +     rm_tmpfiles();                      /* remove temporary files, see below */
  4219. + + #endif
  4220. +   #ifdef TESLA
  4221. +       if (loginsh && do_logout) {
  4222. +       /* this is to send hangup signal to the develcon */
  4223. + ***************
  4224. + *** 2018,2020 ****
  4225. + --- 2056,2196 ----
  4226. +       *blkp = NULL;
  4227. +       return (blk);
  4228. +   }
  4229. + + 
  4230. + + #ifdef __MINT__
  4231. + + /*
  4232. + +  * unlink() doesn't always work on an open file, so we try to arrange
  4233. + +  * to remove temporary files (e.g. for here documents) before exiting.
  4234. + +  */
  4235. + + 
  4236. + + struct tmpfile_rec {
  4237. + +         char *name;     /* the name of the temp. file */
  4238. + +         int pid;        /* the associated pid */
  4239. + +         struct tmpfile_rec *next;
  4240. + + } *root;
  4241. + + 
  4242. + + extern int __mint;
  4243. + + 
  4244. + + int
  4245. + + csh_tmpfile()
  4246. + + {
  4247. + +         extern char *tmpnam();
  4248. + +         struct tmpfile_rec *u;
  4249. + +         int fd;
  4250. + +         char *name;
  4251. + + 
  4252. + +         if ( !(name = tmpnam((char *)0)) )
  4253. + +                 return -1;
  4254. + + 
  4255. + +         fd = open(name, O_CREAT|O_EXCL|O_RDWR, 0600);
  4256. + +         if (fd < 0) {
  4257. + +                 free(name);
  4258. + +                 return -1;
  4259. + +         }
  4260. + + 
  4261. + + /* in MiNT 0.9 and above, we can often unlink a file and continue to use
  4262. + +  * it; some file systems may return EACCDN for unlinking an open file,
  4263. + +  * in which case we use the old method of unlinking the file at exit
  4264. + +  */
  4265. + +         if (__mint >= 9) {
  4266. + +                 if (unlink(name) == 0)
  4267. + +                         return fd;
  4268. + +         }
  4269. + + 
  4270. + + /* if the unlink failed, save the name for future deleting */
  4271. + + 
  4272. + +         u = (struct tmpfile_rec *)malloc(sizeof(*u));
  4273. + +         if (!u) {
  4274. + + /* would it be better to fail? I dunno, but at worst the user is left
  4275. + +  * with a junk file in a temporary directory
  4276. + +  */
  4277. + +                 return fd;
  4278. + +         }
  4279. + + 
  4280. + +         u->name = name;
  4281. + +         u->pid = getpid();
  4282. + +         u->next = root;
  4283. + +         root = u;
  4284. + +         return fd;
  4285. + + }
  4286. + + 
  4287. + + void
  4288. + + rm_tmpfiles()
  4289. + + {
  4290. + +         int pid = getpid();
  4291. + +         struct tmpfile_rec **old, *u;
  4292. + + 
  4293. + +         old = &root;
  4294. + +         u = root;
  4295. + +         while (u) {
  4296. + +                 if (u->pid == pid) {
  4297. + +                         (void) unlink(u->name);
  4298. + +                         *old = u->next;
  4299. + +                 } else {
  4300. + +                         old = &u->next;
  4301. + +                 }
  4302. + +                 u = u->next;
  4303. + +         }
  4304. + + }
  4305. + + 
  4306. + + /* MiNT suffix stuff
  4307. + +  */
  4308. + + 
  4309. + + void
  4310. + + importsuffixes(cp)
  4311. + +     Char   *cp;
  4312. + + {
  4313. + +     register int i = 0;
  4314. + +     register Char *dp;
  4315. + +     register Char **pv;
  4316. + +     int     c;
  4317. + + 
  4318. + +     for (dp = cp; *dp; dp++)
  4319. + +         if (*dp == ',')
  4320. + +             i++;
  4321. + +     /*
  4322. + +      * i+2 where i is the number of ',' in the suffix list. There are i+1
  4323. + +      * suffixes plus we need room for a zero terminator.
  4324. + +      */
  4325. + +     pv = (Char **) xcalloc((size_t) (i + 2), sizeof(Char *));
  4326. + +     dp = cp;
  4327. + +     i = 0;
  4328. + +     if (*dp)
  4329. + +         for (;;) {
  4330. + +             if ((c = *dp) == ',' || c == 0) {
  4331. + +                 *dp = 0;
  4332. + +                 pv[i++] = Strsave(cp);
  4333. + +                 if (c) {
  4334. + +                     cp = dp + 1;
  4335. + +                     *dp = ',';
  4336. + +                 }
  4337. + +                 else
  4338. + +                     break;
  4339. + +             }
  4340. + +             dp++;
  4341. + +         }
  4342. + +     pv[i] = 0;
  4343. + +     set1(STRsuffixes, pv, &shvhed);
  4344. + + }
  4345. + + 
  4346. + + static Char **
  4347. + + defaultsuffixes()
  4348. + + {
  4349. + +     Char  **blk, **blkp;
  4350. + + 
  4351. + +     blkp = blk = (Char **) xmalloc((size_t) sizeof(Char *) * 9);
  4352. + + 
  4353. + +     *blkp++ = SAVE("ttp");
  4354. + +     *blkp++ = SAVE("prg");
  4355. + +     *blkp++ = SAVE("tos");
  4356. + +     *blkp++ = SAVE("app");
  4357. + +     *blkp++ = SAVE("gtp");
  4358. + +     *blkp++ = SAVE("csh");
  4359. + +     *blkp++ = SAVE("");
  4360. + +     *blkp = NULL;
  4361. + + 
  4362. + +     return (blk);
  4363. + + }
  4364. + + 
  4365. + + #endif /* __MINT__ */
  4366. + + 
  4367. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh.h ./sh.h
  4368. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/sh.h    Tue Nov 24 13:04:24 1992
  4369. + --- ./sh.h    Fri Feb 26 01:46:40 1993
  4370. + ***************
  4371. + *** 177,183 ****
  4372. +   #ifdef _SEQUENT_
  4373. +   # include <sys/procstats.h>
  4374. +   #endif /* _SEQUENT_ */
  4375. + ! #if defined(POSIX) || SYSVREL > 0
  4376. +   # include <sys/times.h>
  4377. +   #endif /* POSIX || SYSVREL > 0 */
  4378. +   
  4379. + --- 177,183 ----
  4380. +   #ifdef _SEQUENT_
  4381. +   # include <sys/procstats.h>
  4382. +   #endif /* _SEQUENT_ */
  4383. + ! #if defined(POSIX) || SYSVREL > 0 || defined(__MINT__)
  4384. +   # include <sys/times.h>
  4385. +   #endif /* POSIX || SYSVREL > 0 */
  4386. +   
  4387. + ***************
  4388. + *** 190,195 ****
  4389. + --- 190,199 ----
  4390. +   #endif /* _MINIX && vmsposix atp */
  4391. +   #include <sys/stat.h>
  4392. +   
  4393. + + #ifdef __MINT__
  4394. + + #include <support.h>
  4395. + + #endif
  4396. + + 
  4397. +   #if defined(BSDTIMES) || defined(BSDLIMIT)
  4398. +   # include <sys/time.h>
  4399. +   # if SYSVREL>3 && !defined(sgi)
  4400. + ***************
  4401. + *** 223,229 ****
  4402. +   # include <sys/ttold.h>
  4403. +   #endif /* sonyrisc */
  4404. +   
  4405. + ! #ifdef POSIX
  4406. +   /*
  4407. +    * We should be using setpgid and setpgid
  4408. +    * by now, but in some systems we use the
  4409. + --- 227,233 ----
  4410. +   # include <sys/ttold.h>
  4411. +   #endif /* sonyrisc */
  4412. +   
  4413. + ! #if defined(POSIX) || defined(__MINT__)
  4414. +   /*
  4415. +    * We should be using setpgid and setpgid
  4416. +    * by now, but in some systems we use the
  4417. + ***************
  4418. + *** 289,294 ****
  4419. + --- 293,305 ----
  4420. +   
  4421. +   #include <errno.h>
  4422. +   
  4423. + + #ifdef __MINT__
  4424. + + /* undef E_SEEK from errno.h */
  4425. + + # undef E_SEEK
  4426. + + # define ENOTDIR EPATH
  4427. + + # define ESPIPE EINVAL
  4428. + + #endif
  4429. + + 
  4430. +   #include <setjmp.h>
  4431. +   
  4432. +   #if __STDC__
  4433. + ***************
  4434. + *** 353,358 ****
  4435. + --- 364,384 ----
  4436. +   # endif 
  4437. +   #endif 
  4438. +   
  4439. + + #ifndef DOSFS
  4440. + + # define is_dirsep(c)   ((c) == '/')
  4441. + + # define is_abspath(p)  (is_dirsep(*(p)))
  4442. + + # define lastslash(p)   (strrchr((p), '/'))
  4443. + + # define Lastslash(p)   (Strrchr((p), '/'))
  4444. + + # define has_slash(p)   (any((p), '/'))
  4445. + + # define Has_slash(p)   (Strrchr((p), '/'))
  4446. + + #else
  4447. + + extern int      is_dirsep       __P((int));
  4448. + + extern int      is_abspath      __P((Char *));
  4449. + + extern char *   lastslash       __P((char *));
  4450. + + extern Char *   Lastslash       __P((Char *));
  4451. + + extern int      has_slash       __P((char *));
  4452. + + extern int      Has_slash       __P((Char *));
  4453. + + #endif
  4454. +   
  4455. +   typedef int bool;
  4456. +   
  4457. + Only in .: sldiffs
  4458. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,alloc.c ./tc,alloc.c
  4459. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,alloc.c    Tue Nov 24 13:04:32 1992
  4460. + --- ./tc,alloc.c    Fri Feb 26 02:57:12 1993
  4461. + ***************
  4462. + *** 53,58 ****
  4463. + --- 53,65 ----
  4464. +   
  4465. +   #ifndef SYSMALLOC
  4466. +   
  4467. + + #ifdef __MINT__
  4468. + + /* need large stack because we alloc from stack (cause tcsh assumes
  4469. + +  * continuus memory which MiNT does not provide)
  4470. + +  */
  4471. + + long _stksize = -128*1024L;
  4472. + + #endif
  4473. + + 
  4474. +   #undef RCHECK
  4475. +   #undef DEBUG
  4476. +   
  4477. + ***************
  4478. + *** 244,253 ****
  4479. + --- 251,262 ----
  4480. +       memtop = (char *) op;
  4481. +       if (membot == NULL)
  4482. +       membot = memtop;
  4483. + + #ifndef __MINT__
  4484. +       if ((int) op & 0x3ff) {
  4485. +       memtop = (char *) sbrk(1024 - ((int) op & 0x3ff));
  4486. +       memtop += 1024 - ((int) op & 0x3ff);
  4487. +       }
  4488. + + #endif
  4489. +   
  4490. +       /* take 2k unless the block is bigger than that */
  4491. +       rnu = (bucket <= 8) ? 11 : bucket + 3;
  4492. + ***************
  4493. + *** 469,475 ****
  4494. +   
  4495. +       n = n ? n : 1;
  4496. +   
  4497. + ! #ifndef _VMS_POSIX
  4498. +       if (membot == NULL)
  4499. +       membot == (char*) sbrk(0);
  4500. +   #endif /* !_VMS_POSIX */
  4501. + --- 478,484 ----
  4502. +   
  4503. +       n = n ? n : 1;
  4504. +   
  4505. + ! #if !defined(_VMS_POSIX) && !defined(__MINT__)
  4506. +       if (membot == NULL)
  4507. +       membot == (char*) sbrk(0);
  4508. +   #endif /* !_VMS_POSIX */
  4509. + ***************
  4510. + *** 478,484 ****
  4511. +       child++;
  4512. +       stderror(ERR_NOMEM);
  4513. +       }
  4514. + ! #ifdef _VMS_POSIX
  4515. +       if (memtop < ((char *) ptr) + n)
  4516. +       memtop = ((char *) ptr) + n;
  4517. +       if (membot == NULL)
  4518. + --- 487,493 ----
  4519. +       child++;
  4520. +       stderror(ERR_NOMEM);
  4521. +       }
  4522. + ! #if defined(_VMS_POSIX) || defined(__MINT__)
  4523. +       if (memtop < ((char *) ptr) + n)
  4524. +       memtop = ((char *) ptr) + n;
  4525. +       if (membot == NULL)
  4526. + ***************
  4527. + *** 496,509 ****
  4528. +   
  4529. +       n = n ? n : 1;
  4530. +   
  4531. +       if (membot == NULL)
  4532. +       membot == (char*) sbrk(0);
  4533. +   
  4534. +       if ((ptr = (p ? realloc(p, n) : malloc(n))) == (ptr_t) 0) {
  4535. +       child++;
  4536. +       stderror(ERR_NOMEM);
  4537. +       }
  4538. + ! #ifdef _VMS_POSIX
  4539. +       if (memtop < ((char *) ptr) + n)
  4540. +       memtop = ((char *) ptr) + n;
  4541. +       if (membot == NULL)
  4542. + --- 505,520 ----
  4543. +   
  4544. +       n = n ? n : 1;
  4545. +   
  4546. + + #ifndef __MINT__
  4547. +       if (membot == NULL)
  4548. +       membot == (char*) sbrk(0);
  4549. + + #endif
  4550. +   
  4551. +       if ((ptr = (p ? realloc(p, n) : malloc(n))) == (ptr_t) 0) {
  4552. +       child++;
  4553. +       stderror(ERR_NOMEM);
  4554. +       }
  4555. + ! #if defined(_VMS_POSIX) || defined(__MINT__)
  4556. +       if (memtop < ((char *) ptr) + n)
  4557. +       memtop = ((char *) ptr) + n;
  4558. +       if (membot == NULL)
  4559. + ***************
  4560. + *** 522,529 ****
  4561. + --- 533,542 ----
  4562. +       n *= s;
  4563. +       n = n ? n : 1;
  4564. +   
  4565. + + #ifndef __MINT__
  4566. +       if (membot == NULL)
  4567. +       membot == (char*) sbrk(0);
  4568. + + #endif
  4569. +   
  4570. +       if ((ptr = malloc(n)) == (ptr_t) 0) {
  4571. +       child++;
  4572. + ***************
  4573. + *** 536,542 ****
  4574. +           *sptr++ = 0;
  4575. +       while (--n);
  4576. +   
  4577. + ! #ifdef _VMS_POSIX
  4578. +       if (memtop < ((char *) ptr) + n)
  4579. +       memtop = ((char *) ptr) + n;
  4580. +       if (membot == NULL)
  4581. + --- 549,555 ----
  4582. +           *sptr++ = 0;
  4583. +       while (--n);
  4584. +   
  4585. + ! #if defined(_VMS_POSIX) || defined(__MINT__)
  4586. +       if (memtop < ((char *) ptr) + n)
  4587. +       memtop = ((char *) ptr) + n;
  4588. +       if (membot == NULL)
  4589. + ***************
  4590. + *** 592,598 ****
  4591. +           (unsigned long) membot, (unsigned long) memtop,
  4592. +           (unsigned long) sbrk(0));
  4593. +   #else
  4594. + ! #ifndef _VMS_POSIX
  4595. +       memtop = (char *) sbrk(0);
  4596. +   #endif /* !_VMS_POSIX */
  4597. +       xprintf("Allocated memory from 0x%lx to 0x%lx (%ld).\n",
  4598. + --- 605,611 ----
  4599. +           (unsigned long) membot, (unsigned long) memtop,
  4600. +           (unsigned long) sbrk(0));
  4601. +   #else
  4602. + ! #if !defined(_VMS_POSIX) && !defined(__MINT__)
  4603. +       memtop = (char *) sbrk(0);
  4604. +   #endif /* !_VMS_POSIX */
  4605. +       xprintf("Allocated memory from 0x%lx to 0x%lx (%ld).\n",
  4606. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,const.c ./tc,const.c
  4607. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,const.c    Tue Nov 24 13:04:32 1992
  4608. + --- ./tc,const.c    Fri Feb 26 03:11:00 1993
  4609. + ***************
  4610. + *** 77,91 ****
  4611. + --- 77,101 ----
  4612. +   Char STRhistfile[]     = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' };
  4613. +   Char STRsource[]        = { 's', 'o', 'u', 'r', 'c', 'e', '\0' };
  4614. +   Char STRmh[]            = { '-', 'h', '\0' };
  4615. + + #ifndef DOSFS
  4616. +   Char STRtildothist[]    = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
  4617. +                       'y', '\0' };
  4618. + + #else
  4619. + + Char STRtildothist[]    = { '~', '/', 'h', 'i', 's', 't', 'o', 'r', 'y',
  4620. + +                             '.', 'c', 's', 'h', '\0' };
  4621. + + #endif
  4622. +   
  4623. +   #ifdef KANJI
  4624. +   Char STRnokanji[]       = { 'n', 'o', 'k', 'a', 'n', 'j', 'i', '\0' };
  4625. +   #endif
  4626. +   
  4627. + + #ifndef DOSFS
  4628. +   Char STRtildotdirs[]    = { '~', '/', '.', 'c', 's', 'h', 'd', 'i', 'r',
  4629. +                   's', '\0' };
  4630. + + #else
  4631. + + Char STRtildotdirs[]    = { '~', '/', 'c', 's', 'h', 'd', 'i', 'r', 's',
  4632. + +                             '.', 'c', 's', 'h', '\0' };
  4633. + + #endif
  4634. +   Char STRdirsfile[]      = { 'd', 'i', 'r', 's', 'f', 'i', 'l', 'e', '\0' };
  4635. +   Char STRsavedirs[]      = { 's', 'a', 'v', 'e', 'd', 'i', 'r', 's', '\0' };
  4636. +   Char STRloginsh[]       = { 'l', 'o', 'g', 'i', 'n', 's', 'h', '\0' };
  4637. + ***************
  4638. + *** 93,99 ****
  4639. + --- 103,114 ----
  4640. +   Char STRargv[]          = { 'a', 'r', 'g', 'v', '\0' };
  4641. +   Char STRsavehist[]      = { 's', 'a', 'v', 'e', 'h', 'i', 's', 't', '\0' };
  4642. +   Char STRnormal[]        = { 'n', 'o', 'r', 'm', 'a', 'l', '\0' };
  4643. + + #ifndef DOSFS
  4644. +   Char STRsldtlogout[]    = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' };
  4645. + + #else
  4646. + + Char STRsldtlogout[]    = { '/', 'l', 'o', 'g', 'o', 'u', 't', '.', 'c', 's',
  4647. + +                             'h', '\0' };
  4648. + + #endif
  4649. +   Char STRjobs[]          = { 'j', 'o', 'b', 's', '\0' };
  4650. +   Char STRsymhash[]       = { '#', ' ', '\0' };
  4651. +   Char STRsymarrow[]      = { '>', ' ', '\0' };
  4652. + ***************
  4653. + *** 197,205 ****
  4654. + --- 212,230 ----
  4655. +   Char STRwatch[]        = { 'w', 'a', 't', 'c', 'h', '\0' };
  4656. +   #endif /* HAVENOUTMP */
  4657. +   
  4658. + + #ifndef DOSFS
  4659. +   Char STRsldottcshrc[]    = { '/', '.', 't', 'c', 's', 'h', 'r', 'c', '\0' };
  4660. +   Char STRsldotcshrc[]    = { '/', '.', 'c', 's', 'h', 'r', 'c', '\0' };
  4661. +   Char STRsldotlogin[]    = { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' };
  4662. + + #else
  4663. + + Char STRsldottcshrc[]   = { '/', 't', 'c', 's', 'h', 'r', 'c', '.', 'c',
  4664. + +                             's', 'h', '\0' };
  4665. + + Char STRsldotcshrc[]    = { '/', 'c', 's', 'h', 'r', 'c', '.', 'c', 's',
  4666. + +                             'h', '\0' };
  4667. + + Char STRsldotlogin[]    = { '/', 'l', 'o', 'g', 'i', 'n', '.', 'c', 's',
  4668. + +                             'h', '\0' };
  4669. + + #endif
  4670. + + 
  4671. +   Char STRignoreeof[]    = { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
  4672. +   Char STRnoclobber[]    = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
  4673. +   Char STRhelpcommand[]    = { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n', 
  4674. + ***************
  4675. + *** 284,286 ****
  4676. + --- 309,317 ----
  4677. +   Char STRdown[] = { 'd', 'o', 'w', 'n', '\0' };
  4678. +   Char STRleft[] = { 'l', 'e', 'f', 't', '\0' };
  4679. +   Char STRright[] = { 'r', 'i', 'g', 'h', 't', '\0' };
  4680. + + 
  4681. + + #ifdef __MINT__
  4682. + + Char STRsuffixes[] = { 's', 'u', 'f', 'f', 'i', 'x', 'e', 's', '\0' };
  4683. + + Char STRSUFFIXES[] = { 'S', 'U', 'F', 'F', 'I', 'X', 'E', 'S', '\0' };
  4684. + + #endif
  4685. + + 
  4686. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,func.c ./tc,func.c
  4687. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,func.c    Tue Nov 24 13:04:32 1992
  4688. + --- ./tc,func.c    Fri Feb 26 03:18:42 1993
  4689. + ***************
  4690. + *** 276,282 ****
  4691. +       for (k = 0, i = 0; v[k] != NULL; k++) {
  4692. +           tmp = dnormalize(v[k], symlinks == SYM_IGNORE);
  4693. +           dp = &tmp[Strlen(tmp) - 1];
  4694. + !         if (*dp == '/' && dp != tmp)
  4695. +   #ifdef apollo
  4696. +           if (dp != &tmp[1])
  4697. +   #endif /* apollo */
  4698. + --- 276,282 ----
  4699. +       for (k = 0, i = 0; v[k] != NULL; k++) {
  4700. +           tmp = dnormalize(v[k], symlinks == SYM_IGNORE);
  4701. +           dp = &tmp[Strlen(tmp) - 1];
  4702. + !         if (is_dirsep(*dp) && dp != tmp)
  4703. +   #ifdef apollo
  4704. +           if (dp != &tmp[1])
  4705. +   #endif /* apollo */
  4706. + ***************
  4707. + *** 303,309 ****
  4708. + --- 303,313 ----
  4709. +           xprintf("%S:\n", tmp);
  4710. +           for (cp = tmp, dp = buf; *cp; *dp++ = (*cp++ | QUOTE))
  4711. +               continue;
  4712. + + #if 0
  4713. +           if (dp[-1] != (Char) ('/' | QUOTE))
  4714. + + #else
  4715. + +                 if (! ((dp[-1] & QUOTE) && is_dirsep(dp[-1] & ~QUOTE)))
  4716. + + #endif
  4717. +               *dp++ = '/';
  4718. +           else 
  4719. +               dp[-1] &= TRIM;
  4720. + ***************
  4721. + *** 435,441 ****
  4722. +       int     epl, vpl;
  4723. +   
  4724. +       if ((ep = getenv("EDITOR")) != NULL) {    /* if we have a value */
  4725. + !     if ((p = strrchr(ep, '/')) != NULL)     /* if it has a path */
  4726. +           ep = p + 1;        /* then we want only the last part */
  4727. +       }
  4728. +       else 
  4729. + --- 439,445 ----
  4730. +       int     epl, vpl;
  4731. +   
  4732. +       if ((ep = getenv("EDITOR")) != NULL) {    /* if we have a value */
  4733. + !     if ((p = lastslash(ep)) != NULL)     /* if it has a path */
  4734. +           ep = p + 1;        /* then we want only the last part */
  4735. +       }
  4736. +       else 
  4737. + ***************
  4738. + *** 442,448 ****
  4739. +       ep = "ed";
  4740. +   
  4741. +       if ((vp = getenv("VISUAL")) != NULL) {    /* if we have a value */
  4742. + !     if ((p = strrchr(vp, '/')) != NULL)     /* and it has a path */
  4743. +           vp = p + 1;        /* then we want only the last part */
  4744. +       }
  4745. +       else 
  4746. + --- 446,452 ----
  4747. +       ep = "ed";
  4748. +   
  4749. +       if ((vp = getenv("VISUAL")) != NULL) {    /* if we have a value */
  4750. + !     if ((p = lastslash(vp)) != NULL)     /* and it has a path */
  4751. +           vp = p + 1;        /* then we want only the last part */
  4752. +       }
  4753. +       else 
  4754. + ***************
  4755. + *** 462,468 ****
  4756. +           continue;
  4757. +           *cp = '\0';
  4758. +           
  4759. + !         if ((cp = strrchr(p, '/')) != NULL)    /* and it has a path */
  4760. +           cp = cp + 1;        /* then we want only the last part */
  4761. +           else
  4762. +           cp = p;            /* else we get all of it */
  4763. + --- 466,472 ----
  4764. +           continue;
  4765. +           *cp = '\0';
  4766. +           
  4767. + !         if ((cp = lastslash(p)) != NULL)    /* and it has a path */
  4768. +           cp = cp + 1;        /* then we want only the last part */
  4769. +           else
  4770. +           cp = p;            /* else we get all of it */
  4771. + ***************
  4772. + *** 1405,1417 ****
  4773. +       }
  4774. +       if (((h = value(STRhome)) != STRNULL) &&
  4775. +       (Strncmp(p = *hm, h, j = Strlen(h)) == 0) &&
  4776. + !     (p[j] == '/' || p[j] == '\0')) {
  4777. +       *hm = &p[j];
  4778. +       return STRNULL;
  4779. +       }
  4780. +       for (i = 0; i < tlength; i++)
  4781. +       if ((Strncmp(p = *hm, tcache[i].home, j = tcache[i].hlen) == 0) &&
  4782. + !         (p[j] == '/' || p[j] == '\0')) {
  4783. +           *hm = &p[j];
  4784. +           return tcache[i].user;
  4785. +       }
  4786. + --- 1409,1421 ----
  4787. +       }
  4788. +       if (((h = value(STRhome)) != STRNULL) &&
  4789. +       (Strncmp(p = *hm, h, j = Strlen(h)) == 0) &&
  4790. + !     (is_dirsep(p[j]) || p[j] == '\0')) {
  4791. +       *hm = &p[j];
  4792. +       return STRNULL;
  4793. +       }
  4794. +       for (i = 0; i < tlength; i++)
  4795. +       if ((Strncmp(p = *hm, tcache[i].home, j = tcache[i].hlen) == 0) &&
  4796. + !         (is_dirsep(p[j]) || p[j] == '\0')) {
  4797. +           *hm = &p[j];
  4798. +           return tcache[i].user;
  4799. +       }
  4800. + ***************
  4801. + *** 1471,1478 ****
  4802. + --- 1475,1490 ----
  4803. +   
  4804. +               if ((n = read(fd, tbuf, BUFSIZE)) <= 0)
  4805. +               goto eof;
  4806. + + #ifdef DOSTEXT
  4807. + +         /* we probably should strip the carriage returns, but
  4808. + +          * changing them to blanks will work just as well for most cases
  4809. + +          */
  4810. + +                     for (i = 0; i < n; i++)
  4811. + +                         buf[i] = (tbuf[i] == '\r') ? ' ' : tbuf[i];
  4812. + + #else
  4813. +               for (i = 0; i < n; i++)
  4814. +               buf[i] = tbuf[i];
  4815. + + #endif
  4816. +               p = buf;
  4817. +           }
  4818. +           n--;
  4819. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,os.c ./tc,os.c
  4820. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,os.c    Tue Nov 24 13:04:32 1992
  4821. + --- ./tc,os.c    Fri Feb 26 03:21:36 1993
  4822. + ***************
  4823. + *** 1036,1042 ****
  4824. +       /* look if we found root yet */
  4825. +       if (st_cur.st_ino == st_root.st_ino &&
  4826. +           DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) {
  4827. + !         (void) strcpy(pathname, *pathptr != '/' ? "/" : pathptr);
  4828. +           return (pathname);
  4829. +       }
  4830. +   
  4831. + --- 1036,1042 ----
  4832. +       /* look if we found root yet */
  4833. +       if (st_cur.st_ino == st_root.st_ino &&
  4834. +           DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) {
  4835. + !         (void) strcpy(pathname, !is_dirsep(*pathptr) ? "/" : pathptr);
  4836. +           return (pathname);
  4837. +       }
  4838. +   
  4839. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,os.h ./tc,os.h
  4840. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,os.h    Tue Nov 24 13:04:32 1992
  4841. + --- ./tc,os.h    Fri Feb 26 03:24:24 1993
  4842. + ***************
  4843. + *** 479,484 ****
  4844. + --- 479,485 ----
  4845. +   extern int qsort();
  4846. +   # endif
  4847. +   #else
  4848. + + # ifndef __MINT__
  4849. +   # ifndef hpux
  4850. +   #  if __GNUC__ != 2
  4851. +   extern int abort();
  4852. + ***************
  4853. + *** 490,495 ****
  4854. + --- 491,497 ----
  4855. +   extern void abort();
  4856. +   extern void qsort();
  4857. +   # endif
  4858. + + # endif /* !__MINT__ */
  4859. +   #endif    /* SUNOS4 */
  4860. +   extern void perror();
  4861. +   
  4862. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,promp.c ./tc,promp.c
  4863. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,promp.c    Tue Nov 24 13:04:34 1992
  4864. + --- ./tc,promp.c    Fri Feb 26 03:28:40 1993
  4865. + ***************
  4866. + *** 303,309 ****
  4867. +               else {
  4868. +               if ((scp != 'C') && (q = value(STRhome)) != STRNULL &&
  4869. +                   Strncmp(buff, q, (k = Strlen(q))) == 0 &&
  4870. + !                 (buff[k] == '/' || buff[k] == '\0')) {
  4871. +                   buff[--k] = '~';
  4872. +                   q = &buff[k];
  4873. +                   /* RWM - reset the path length */
  4874. + --- 303,309 ----
  4875. +               else {
  4876. +               if ((scp != 'C') && (q = value(STRhome)) != STRNULL &&
  4877. +                   Strncmp(buff, q, (k = Strlen(q))) == 0 &&
  4878. + !                 (is_dirsep(buff[k]) || buff[k] == '\0')) {
  4879. +                   buff[--k] = '~';
  4880. +                   q = &buff[k];
  4881. +                   /* RWM - reset the path length */
  4882. + ***************
  4883. + *** 312,322 ****
  4884. +               else {
  4885. +                   q = buff;
  4886. +                   /* RWM - in case first char is not '/' */
  4887. + !                 if (*q == '/') updirs = 0; else updirs = 1;
  4888. +               }
  4889. +               /* RWM - calculate elements in the path */
  4890. +               for (z = q; *z; z++) {
  4891. + !                 if (*z == '/') updirs++;
  4892. +                   continue;    /* find the end */
  4893. +               }
  4894. +               /* RWM - the ones we will skip can be found here */
  4895. + --- 312,322 ----
  4896. +               else {
  4897. +                   q = buff;
  4898. +                   /* RWM - in case first char is not '/' */
  4899. + !                 if (is_abspath(q)) updirs = 0; else updirs = 1;
  4900. +               }
  4901. +               /* RWM - calculate elements in the path */
  4902. +               for (z = q; *z; z++) {
  4903. + !                 if (is_dirsep(*z)) updirs++;
  4904. +                   continue;    /* find the end */
  4905. +               }
  4906. +               /* RWM - the ones we will skip can be found here */
  4907. + ***************
  4908. + *** 323,334 ****
  4909. +               updirs -= j;
  4910. +               
  4911. +               while (j-- > 0) {
  4912. + !                 while ((z > q) && (*z != '/'))
  4913. +                   z--;    /* back up */
  4914. +                   if (j && z > q)
  4915. +                   z--;
  4916. +               }
  4917. + !             if (*z == '/' && z != q)
  4918. +                   z++;
  4919. +   
  4920. +               /* RWM - if *q == '~' and *z != '~' then print */
  4921. + --- 323,334 ----
  4922. +               updirs -= j;
  4923. +               
  4924. +               while (j-- > 0) {
  4925. + !                 while ((z > q) && (!is_dirsep(*z)))
  4926. +                   z--;    /* back up */
  4927. +                   if (j && z > q)
  4928. +                   z--;
  4929. +               }
  4930. + !             if (is_dirsep(*z) && z != q)
  4931. +                   z++;
  4932. +   
  4933. +               /* RWM - if *q == '~' and *z != '~' then print */
  4934. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,sig.c ./tc,sig.c
  4935. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,sig.c    Tue Nov 24 13:04:34 1992
  4936. + --- ./tc,sig.c    Fri Feb 26 03:33:50 1993
  4937. + ***************
  4938. + *** 410,412 ****
  4939. + --- 410,433 ----
  4940. +       Synch_Cnt++;
  4941. +   }
  4942. +   #endif /* SIGSYNCH */
  4943. + + 
  4944. + + #ifdef __MINT__
  4945. + + /* MiNT has most BSD signal things, but not sigvec; punt */
  4946. + + void
  4947. + + mysigvec(sig, new, old)
  4948. + +         int sig;
  4949. + +         sigvec_t *new, *old;
  4950. + + {
  4951. + +         void (*oldhandler)();
  4952. + + 
  4953. + +         if (new) {
  4954. + +                 oldhandler = signal(sig, new->sv_handler);
  4955. + +         } else {
  4956. + +                 oldhandler = signal(sig, SIG_IGN);
  4957. + +                 signal(sig, oldhandler);
  4958. + +         }
  4959. + +         if (old)
  4960. + +                 old->sv_handler = oldhandler;
  4961. + + }
  4962. + + #endif /* __MINT__ */
  4963. + + 
  4964. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,sig.h ./tc,sig.h
  4965. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tc,sig.h    Tue Nov 24 13:04:34 1992
  4966. + --- ./tc,sig.h    Fri Feb 26 03:31:38 1993
  4967. + ***************
  4968. + *** 77,82 ****
  4969. + --- 77,90 ----
  4970. +   #  define NEEDsignal
  4971. +   # endif /* hpux */
  4972. +   
  4973. + + # ifdef __MINT__
  4974. + + #  define HAVE_SIGVEC
  4975. + + typedef struct sigvec {
  4976. + +         sigret_t (*sv_handler)();
  4977. + + } sigvec_t;
  4978. + + extern void mysigvec __P((int, sigvec_t *, sigvec_t *));
  4979. + + #endif /* __MINT__ */
  4980. + + 
  4981. +   # ifndef HAVE_SIGVEC
  4982. +   #  define mysigvec(a, b, c)    sigvec(a, b, c)
  4983. +   typedef struct sigvec sigvec_t;
  4984. + ***************
  4985. + *** 130,139 ****
  4986. + --- 138,149 ----
  4987. +   /*
  4988. +    * For 4.2bsd signals.
  4989. +    */
  4990. + + # ifndef __MINT__
  4991. +   # ifdef sigmask
  4992. +   #  undef sigmask
  4993. +   # endif /* sigmask */
  4994. +   # define    sigmask(s)    (1 << ((s)-1))
  4995. + + # endif /* !__MINT__ */
  4996. +   # ifdef POSIXSIGS
  4997. +   #  define     sigpause(a)    bsd_sigpause(a)
  4998. +   #  define     signal(a, b)    bsd_signal(a, b)
  4999. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,init.c ./tw,init.c
  5000. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,init.c    Tue Nov 24 13:04:26 1992
  5001. + --- ./tw,init.c    Fri Feb 26 03:41:34 1993
  5002. + ***************
  5003. + *** 247,259 ****
  5004. +       register Char **pv;
  5005. +       struct varent *v = adrof(STRpath);
  5006. +       struct varent *recexec = adrof(STRrecognize_only_executables);
  5007. +   
  5008. + - 
  5009. +       if (v == NULL) /* if no path */
  5010. +       return;
  5011. +   
  5012. +       for (pv = v->vec; *pv; pv++) {
  5013. + !     if (pv[0][0] != '/') {
  5014. +           tw_cmd_got |= TW_FL_REL;
  5015. +           continue;
  5016. +       }
  5017. + --- 247,262 ----
  5018. +       register Char **pv;
  5019. +       struct varent *v = adrof(STRpath);
  5020. +       struct varent *recexec = adrof(STRrecognize_only_executables);
  5021. + + #ifdef __MINT__
  5022. + +     struct varent *suffv = adrof(STRsuffixes);
  5023. + +     Char **suffpv;
  5024. + + #endif
  5025. +   
  5026. +       if (v == NULL) /* if no path */
  5027. +       return;
  5028. +   
  5029. +       for (pv = v->vec; *pv; pv++) {
  5030. + !     if (!is_abspath(pv[0])) {
  5031. +           tw_cmd_got |= TW_FL_REL;
  5032. +           continue;
  5033. +       }
  5034. + ***************
  5035. + *** 268,273 ****
  5036. + --- 271,289 ----
  5037. +           name = str2short(dp->d_name);
  5038. +           if (dp->d_ino == 0 || (recexec && !executable(dir, name, 0)))
  5039. +           continue;
  5040. + + #ifdef __MINT__
  5041. + +             {   char *s = rindex(name, '.');
  5042. + + 
  5043. + +                 if (s && suffv) {
  5044. + +                     for (suffpv = suffv->vec; *suffpv; suffpv++) {
  5045. + +                         if (!strcmp(s+1, short2str(*suffpv))) {
  5046. + +                             *s = 0; break;
  5047. + +                         }
  5048. + +                     }
  5049. + +                 }
  5050. + +             }
  5051. + + #endif /* __MINT__ */
  5052. + + 
  5053. +           tw_cmd_add(name);
  5054. +       }
  5055. +       (void) closedir(dirp);
  5056. + ***************
  5057. + *** 421,427 ****
  5058. +   
  5059. +           CLRDIR(tw_cmd_state.dfd)
  5060. +   
  5061. + !     while (*tw_cmd_state.pathv && tw_cmd_state.pathv[0][0] == '/')
  5062. +           tw_cmd_state.pathv++;
  5063. +       if ((ptr = *tw_cmd_state.pathv) != 0) {
  5064. +           /*
  5065. + --- 437,443 ----
  5066. +   
  5067. +           CLRDIR(tw_cmd_state.dfd)
  5068. +   
  5069. + !     while (*tw_cmd_state.pathv && is_abspath(tw_cmd_state.pathv[0]))
  5070. +           tw_cmd_state.pathv++;
  5071. +       if ((ptr = *tw_cmd_state.pathv) != 0) {
  5072. +           /*
  5073. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,parse.c ./tw,parse.c
  5074. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,parse.c    Tue Nov 24 13:04:26 1992
  5075. + --- ./tw,parse.c    Fri Feb 26 03:50:14 1993
  5076. + ***************
  5077. + *** 261,267 ****
  5078. +       case RECOGNIZE:
  5079. +       case RECOGNIZE_ALL:
  5080. +       if (adrof(STRautocorrect)) {
  5081. + !         if ((slshp = Strrchr(wordp, '/')) != NULL && slshp[1] != '\0') {
  5082. +           SearchNoDirErr = 1;
  5083. +           for (bptr = wordp; bptr < slshp; bptr++) {
  5084. +               /*
  5085. + --- 261,267 ----
  5086. +       case RECOGNIZE:
  5087. +       case RECOGNIZE_ALL:
  5088. +       if (adrof(STRautocorrect)) {
  5089. + !         if ((slshp = Lastslash(wordp)) != NULL && slshp[1] != '\0') {
  5090. +           SearchNoDirErr = 1;
  5091. +           for (bptr = wordp; bptr < slshp; bptr++) {
  5092. +               /*
  5093. + ***************
  5094. + *** 350,356 ****
  5095. +       items[0] = buffer;
  5096. +       items[1] = NULL;
  5097. +       ptr = items;
  5098. + !     count = (looking == TW_COMMAND && Strchr(wordp, '/') == 0) ? 
  5099. +           c_glob(&ptr) : 
  5100. +           t_glob(&ptr, looking == TW_COMMAND);
  5101. +       if (count > 0) {
  5102. + --- 350,356 ----
  5103. +       items[0] = buffer;
  5104. +       items[1] = NULL;
  5105. +       ptr = items;
  5106. + !     count = (looking == TW_COMMAND && !Has_slash(wordp)) ? 
  5107. +           c_glob(&ptr) : 
  5108. +           t_glob(&ptr, looking == TW_COMMAND);
  5109. +       if (count > 0) {
  5110. + ***************
  5111. + *** 1156,1162 ****
  5112. +       break;
  5113. +   
  5114. +       case TW_COMMAND:
  5115. + !     if (Strchr(word, '/')) {
  5116. +           looking = TW_FILE;
  5117. +           flags |= TW_EXEC_CHK;
  5118. +           flags |= TW_DIR_OK;
  5119. + --- 1156,1162 ----
  5120. +       break;
  5121. +   
  5122. +       case TW_COMMAND:
  5123. + !     if (Has_slash(word)) {
  5124. +           looking = TW_FILE;
  5125. +           flags |= TW_EXEC_CHK;
  5126. +           flags |= TW_DIR_OK;
  5127. + ***************
  5128. + *** 1197,1208 ****
  5129. +        */
  5130. +       flags |= (gpat == 0) ? TW_IGN_OK : TW_PAT_OK;
  5131. +   
  5132. + !     if ((*word == '~') && (Strchr(word, '/') == NULL)) {
  5133. +       looking = TW_LOGNAME;
  5134. +       target = name;
  5135. +       }
  5136. +       else if ((target = Strrchr(name, '$')) != 0 && 
  5137. + !          (Strchr(name, '/') == NULL)) {
  5138. +       target++;
  5139. +       looking = TW_VARIABLE;
  5140. +       }
  5141. + --- 1197,1208 ----
  5142. +        */
  5143. +       flags |= (gpat == 0) ? TW_IGN_OK : TW_PAT_OK;
  5144. +   
  5145. + !     if ((*word == '~') && (! Has_slash(word))) {
  5146. +       looking = TW_LOGNAME;
  5147. +       target = name;
  5148. +       }
  5149. +       else if ((target = Strrchr(name, '$')) != 0 && 
  5150. + !          (! Has_slash(name))) {
  5151. +       target++;
  5152. +       looking = TW_VARIABLE;
  5153. +       }
  5154. + ***************
  5155. + *** 1371,1377 ****
  5156. +   {
  5157. +       register Char *p;
  5158. +   
  5159. + !     p = Strrchr(path, '/');
  5160. +       if (p == NULL) {
  5161. +       copyn(name, path, MAXNAMLEN);
  5162. +       dir[0] = '\0';
  5163. + --- 1371,1377 ----
  5164. +   {
  5165. +       register Char *p;
  5166. +   
  5167. + !     p = Lastslash(path);
  5168. +       if (p == NULL) {
  5169. +       copyn(name, path, MAXNAMLEN);
  5170. +       dir[0] = '\0';
  5171. + ***************
  5172. + *** 1448,1454 ****
  5173. +   
  5174. +       switch (old[0]) {
  5175. +       case '~':
  5176. + !     for (p = new, o = &old[1]; *o && *o != '/'; *p++ = *o++) 
  5177. +           continue;
  5178. +       *p = '\0';
  5179. +       if (gethdir(new)) {
  5180. + --- 1448,1454 ----
  5181. +   
  5182. +       switch (old[0]) {
  5183. +       case '~':
  5184. + !     for (p = new, o = &old[1]; *o && !is_dirsep(*o); *p++ = *o++) 
  5185. +           continue;
  5186. +       *p = '\0';
  5187. +       if (gethdir(new)) {
  5188. + ***************
  5189. + *** 1516,1525 ****
  5190. +            */
  5191. +           for (p = edir; *p; p++)
  5192. +           continue;
  5193. + !         if (*--p == '/') {
  5194. +           for (p = nd; *p; p++)
  5195. +               continue;
  5196. + !         if (*--p != '/')
  5197. +               p = NULL;
  5198. +           }
  5199. +           for (d = edir, s = nd; (*d++ = *s++) != '\0';)
  5200. + --- 1516,1525 ----
  5201. +            */
  5202. +           for (p = edir; *p; p++)
  5203. +           continue;
  5204. + !         if (is_dirsep(*--p)) {
  5205. +           for (p = nd; *p; p++)
  5206. +               continue;
  5207. + !         if (!is_dirsep(*--p))
  5208. +               p = NULL;
  5209. +           }
  5210. +           for (d = edir, s = nd; (*d++ = *s++) != '\0';)
  5211. + diff +context /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,spell.c ./tw,spell.c
  5212. + *** /usr/users/staff/hohmuth/tmp/tcsh-6.03/tw,spell.c    Tue Nov 24 13:04:26 1992
  5213. + --- ./tw,spell.c    Fri Feb 26 03:54:20 1993
  5214. + ***************
  5215. + *** 53,60 ****
  5216. +       bool    foundslash = 0;
  5217. +       int     retval;
  5218. +   
  5219. +       for (;;) {
  5220. + !     while (*old == '/') {    /* skip '/' */
  5221. +           *new++ = *old++;
  5222. +           foundslash = 1;
  5223. +       }
  5224. + --- 53,67 ----
  5225. +       bool    foundslash = 0;
  5226. +       int     retval;
  5227. +   
  5228. + + #ifdef DOSFS
  5229. + +     /* skip drive specification, if any */
  5230. + +     if (*old && old[1] == ':' && is_dirsep(old[2])) {
  5231. + +         *new++ = *old++; *new++ = *old++;
  5232. + +     }
  5233. + + #endif
  5234. + + 
  5235. +       for (;;) {
  5236. + !     while (is_dirsep(*old)) {    /* skip '/' */
  5237. +           *new++ = *old++;
  5238. +           foundslash = 1;
  5239. +       }
  5240. + ***************
  5241. + *** 73,79 ****
  5242. +           if (p < guess + FILSIZ)
  5243. +               *p++ = *cp;
  5244. +       ws = p;
  5245. + !     for (; *old != '/' && *old != '\0'; old++)/* add current file name */
  5246. +           if (p < guess + FILSIZ)
  5247. +           *p++ = *old;
  5248. +       *p = '\0';        /* terminate it */
  5249. + --- 80,86 ----
  5250. +           if (p < guess + FILSIZ)
  5251. +               *p++ = *cp;
  5252. +       ws = p;
  5253. + !     for (; !is_dirsep(*old) && *old != '\0'; old++)/* add current file name */
  5254. +           if (p < guess + FILSIZ)
  5255. +           *p++ = *old;
  5256. +       *p = '\0';        /* terminate it */
  5257. + ***************
  5258. + *** 84,90 ****
  5259. +        */
  5260. +       /* (*should* say "looking for directory" whenever '/' is next...) */
  5261. +       retval = t_search(guess, p, SPELL, FILSIZ,
  5262. + !               looking == TW_COMMAND && (foundslash || *old != '/') ?
  5263. +                 TW_COMMAND : looking, 1, STRNULL, 0);
  5264. +       if (retval >= 4 || retval < 0)
  5265. +           return -1;        /* hopeless */
  5266. + --- 91,97 ----
  5267. +        */
  5268. +       /* (*should* say "looking for directory" whenever '/' is next...) */
  5269. +       retval = t_search(guess, p, SPELL, FILSIZ,
  5270. + !               looking == TW_COMMAND && (foundslash || !is_dirsep(*old)) ?
  5271. +                 TW_COMMAND : looking, 1, STRNULL, 0);
  5272. +       if (retval >= 4 || retval < 0)
  5273. +           return -1;        /* hopeless */
  5274. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.alloc.c ./tc.alloc.c
  5275. *** ../../store/tcsh-6.03/tc.alloc.c    Tue Nov 24 13:04:32 1992
  5276. --- ./tc.alloc.c    Thu Mar 11 00:30:52 1993
  5277. ***************
  5278. *** 53,58 ****
  5279. --- 53,65 ----
  5280.   
  5281.   #ifndef SYSMALLOC
  5282.   
  5283. + #ifdef __MINT__
  5284. + /* need large stack because we alloc from stack (cause tcsh assumes
  5285. +  * continuus memory which MiNT does not provide)
  5286. +  */
  5287. + long _stksize = -128*1024L;
  5288. + #endif
  5289.   #undef RCHECK
  5290.   #undef DEBUG
  5291.   
  5292. ***************
  5293. *** 244,253 ****
  5294. --- 251,262 ----
  5295.       memtop = (char *) op;
  5296.       if (membot == NULL)
  5297.       membot = memtop;
  5298. + #ifndef __MINT__
  5299.       if ((int) op & 0x3ff) {
  5300.       memtop = (char *) sbrk(1024 - ((int) op & 0x3ff));
  5301.       memtop += 1024 - ((int) op & 0x3ff);
  5302.       }
  5303. + #endif
  5304.   
  5305.       /* take 2k unless the block is bigger than that */
  5306.       rnu = (bucket <= 8) ? 11 : bucket + 3;
  5307. ***************
  5308. *** 449,454 ****
  5309. --- 458,469 ----
  5310.   
  5311.   #else                /* SYSMALLOC */
  5312.   
  5313. + #ifdef __MINT__
  5314. + /* Stack for MiNT
  5315. +  */
  5316. + long _stksize = 20*1024L;
  5317. + #endif /* __MINT__ */
  5318.   /**
  5319.    ** ``Protected versions'' of malloc, realloc, calloc, and free
  5320.    **
  5321. ***************
  5322. *** 469,475 ****
  5323.   
  5324.       n = n ? n : 1;
  5325.   
  5326. ! #ifndef _VMS_POSIX
  5327.       if (membot == NULL)
  5328.       membot == (char*) sbrk(0);
  5329.   #endif /* !_VMS_POSIX */
  5330. --- 484,490 ----
  5331.   
  5332.       n = n ? n : 1;
  5333.   
  5334. ! #if !defined(_VMS_POSIX) && !defined(__MINT__)
  5335.       if (membot == NULL)
  5336.       membot == (char*) sbrk(0);
  5337.   #endif /* !_VMS_POSIX */
  5338. ***************
  5339. *** 478,484 ****
  5340.       child++;
  5341.       stderror(ERR_NOMEM);
  5342.       }
  5343. ! #ifdef _VMS_POSIX
  5344.       if (memtop < ((char *) ptr) + n)
  5345.       memtop = ((char *) ptr) + n;
  5346.       if (membot == NULL)
  5347. --- 493,499 ----
  5348.       child++;
  5349.       stderror(ERR_NOMEM);
  5350.       }
  5351. ! #if defined(_VMS_POSIX) || defined(__MINT__)
  5352.       if (memtop < ((char *) ptr) + n)
  5353.       memtop = ((char *) ptr) + n;
  5354.       if (membot == NULL)
  5355. ***************
  5356. *** 496,509 ****
  5357.   
  5358.       n = n ? n : 1;
  5359.   
  5360.       if (membot == NULL)
  5361.       membot == (char*) sbrk(0);
  5362.   
  5363.       if ((ptr = (p ? realloc(p, n) : malloc(n))) == (ptr_t) 0) {
  5364.       child++;
  5365.       stderror(ERR_NOMEM);
  5366.       }
  5367. ! #ifdef _VMS_POSIX
  5368.       if (memtop < ((char *) ptr) + n)
  5369.       memtop = ((char *) ptr) + n;
  5370.       if (membot == NULL)
  5371. --- 511,526 ----
  5372.   
  5373.       n = n ? n : 1;
  5374.   
  5375. + #ifndef __MINT__
  5376.       if (membot == NULL)
  5377.       membot == (char*) sbrk(0);
  5378. + #endif
  5379.   
  5380.       if ((ptr = (p ? realloc(p, n) : malloc(n))) == (ptr_t) 0) {
  5381.       child++;
  5382.       stderror(ERR_NOMEM);
  5383.       }
  5384. ! #if defined(_VMS_POSIX) || defined(__MINT__)
  5385.       if (memtop < ((char *) ptr) + n)
  5386.       memtop = ((char *) ptr) + n;
  5387.       if (membot == NULL)
  5388. ***************
  5389. *** 522,529 ****
  5390. --- 539,548 ----
  5391.       n *= s;
  5392.       n = n ? n : 1;
  5393.   
  5394. + #ifndef __MINT__
  5395.       if (membot == NULL)
  5396.       membot == (char*) sbrk(0);
  5397. + #endif
  5398.   
  5399.       if ((ptr = malloc(n)) == (ptr_t) 0) {
  5400.       child++;
  5401. ***************
  5402. *** 536,542 ****
  5403.           *sptr++ = 0;
  5404.       while (--n);
  5405.   
  5406. ! #ifdef _VMS_POSIX
  5407.       if (memtop < ((char *) ptr) + n)
  5408.       memtop = ((char *) ptr) + n;
  5409.       if (membot == NULL)
  5410. --- 555,561 ----
  5411.           *sptr++ = 0;
  5412.       while (--n);
  5413.   
  5414. ! #if defined(_VMS_POSIX) || defined(__MINT__)
  5415.       if (memtop < ((char *) ptr) + n)
  5416.       memtop = ((char *) ptr) + n;
  5417.       if (membot == NULL)
  5418. ***************
  5419. *** 592,598 ****
  5420.           (unsigned long) membot, (unsigned long) memtop,
  5421.           (unsigned long) sbrk(0));
  5422.   #else
  5423. ! #ifndef _VMS_POSIX
  5424.       memtop = (char *) sbrk(0);
  5425.   #endif /* !_VMS_POSIX */
  5426.       xprintf("Allocated memory from 0x%lx to 0x%lx (%ld).\n",
  5427. --- 611,617 ----
  5428.           (unsigned long) membot, (unsigned long) memtop,
  5429.           (unsigned long) sbrk(0));
  5430.   #else
  5431. ! #if !defined(_VMS_POSIX) && !defined(__MINT__)
  5432.       memtop = (char *) sbrk(0);
  5433.   #endif /* !_VMS_POSIX */
  5434.       xprintf("Allocated memory from 0x%lx to 0x%lx (%ld).\n",
  5435. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.const.c ./tc.const.c
  5436. *** ../../store/tcsh-6.03/tc.const.c    Tue Nov 24 13:04:32 1992
  5437. --- ./tc.const.c    Fri Feb 26 03:11:00 1993
  5438. ***************
  5439. *** 77,91 ****
  5440. --- 77,101 ----
  5441.   Char STRhistfile[]     = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' };
  5442.   Char STRsource[]        = { 's', 'o', 'u', 'r', 'c', 'e', '\0' };
  5443.   Char STRmh[]            = { '-', 'h', '\0' };
  5444. + #ifndef DOSFS
  5445.   Char STRtildothist[]    = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', 
  5446.                       'y', '\0' };
  5447. + #else
  5448. + Char STRtildothist[]    = { '~', '/', 'h', 'i', 's', 't', 'o', 'r', 'y',
  5449. +                             '.', 'c', 's', 'h', '\0' };
  5450. + #endif
  5451.   
  5452.   #ifdef KANJI
  5453.   Char STRnokanji[]       = { 'n', 'o', 'k', 'a', 'n', 'j', 'i', '\0' };
  5454.   #endif
  5455.   
  5456. + #ifndef DOSFS
  5457.   Char STRtildotdirs[]    = { '~', '/', '.', 'c', 's', 'h', 'd', 'i', 'r',
  5458.                   's', '\0' };
  5459. + #else
  5460. + Char STRtildotdirs[]    = { '~', '/', 'c', 's', 'h', 'd', 'i', 'r', 's',
  5461. +                             '.', 'c', 's', 'h', '\0' };
  5462. + #endif
  5463.   Char STRdirsfile[]      = { 'd', 'i', 'r', 's', 'f', 'i', 'l', 'e', '\0' };
  5464.   Char STRsavedirs[]      = { 's', 'a', 'v', 'e', 'd', 'i', 'r', 's', '\0' };
  5465.   Char STRloginsh[]       = { 'l', 'o', 'g', 'i', 'n', 's', 'h', '\0' };
  5466. ***************
  5467. *** 93,99 ****
  5468. --- 103,114 ----
  5469.   Char STRargv[]          = { 'a', 'r', 'g', 'v', '\0' };
  5470.   Char STRsavehist[]      = { 's', 'a', 'v', 'e', 'h', 'i', 's', 't', '\0' };
  5471.   Char STRnormal[]        = { 'n', 'o', 'r', 'm', 'a', 'l', '\0' };
  5472. + #ifndef DOSFS
  5473.   Char STRsldtlogout[]    = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' };
  5474. + #else
  5475. + Char STRsldtlogout[]    = { '/', 'l', 'o', 'g', 'o', 'u', 't', '.', 'c', 's',
  5476. +                             'h', '\0' };
  5477. + #endif
  5478.   Char STRjobs[]          = { 'j', 'o', 'b', 's', '\0' };
  5479.   Char STRsymhash[]       = { '#', ' ', '\0' };
  5480.   Char STRsymarrow[]      = { '>', ' ', '\0' };
  5481. ***************
  5482. *** 197,205 ****
  5483. --- 212,230 ----
  5484.   Char STRwatch[]        = { 'w', 'a', 't', 'c', 'h', '\0' };
  5485.   #endif /* HAVENOUTMP */
  5486.   
  5487. + #ifndef DOSFS
  5488.   Char STRsldottcshrc[]    = { '/', '.', 't', 'c', 's', 'h', 'r', 'c', '\0' };
  5489.   Char STRsldotcshrc[]    = { '/', '.', 'c', 's', 'h', 'r', 'c', '\0' };
  5490.   Char STRsldotlogin[]    = { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' };
  5491. + #else
  5492. + Char STRsldottcshrc[]   = { '/', 't', 'c', 's', 'h', 'r', 'c', '.', 'c',
  5493. +                             's', 'h', '\0' };
  5494. + Char STRsldotcshrc[]    = { '/', 'c', 's', 'h', 'r', 'c', '.', 'c', 's',
  5495. +                             'h', '\0' };
  5496. + Char STRsldotlogin[]    = { '/', 'l', 'o', 'g', 'i', 'n', '.', 'c', 's',
  5497. +                             'h', '\0' };
  5498. + #endif
  5499.   Char STRignoreeof[]    = { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
  5500.   Char STRnoclobber[]    = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
  5501.   Char STRhelpcommand[]    = { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n', 
  5502. ***************
  5503. *** 284,286 ****
  5504. --- 309,317 ----
  5505.   Char STRdown[] = { 'd', 'o', 'w', 'n', '\0' };
  5506.   Char STRleft[] = { 'l', 'e', 'f', 't', '\0' };
  5507.   Char STRright[] = { 'r', 'i', 'g', 'h', 't', '\0' };
  5508. + #ifdef __MINT__
  5509. + Char STRsuffixes[] = { 's', 'u', 'f', 'f', 'i', 'x', 'e', 's', '\0' };
  5510. + Char STRSUFFIXES[] = { 'S', 'U', 'F', 'F', 'I', 'X', 'E', 'S', '\0' };
  5511. + #endif
  5512. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.func.c ./tc.func.c
  5513. *** ../../store/tcsh-6.03/tc.func.c    Tue Nov 24 13:04:32 1992
  5514. --- ./tc.func.c    Thu Mar 11 03:10:24 1993
  5515. ***************
  5516. *** 276,282 ****
  5517.       for (k = 0, i = 0; v[k] != NULL; k++) {
  5518.           tmp = dnormalize(v[k], symlinks == SYM_IGNORE);
  5519.           dp = &tmp[Strlen(tmp) - 1];
  5520. !         if (*dp == '/' && dp != tmp)
  5521.   #ifdef apollo
  5522.           if (dp != &tmp[1])
  5523.   #endif /* apollo */
  5524. --- 276,282 ----
  5525.       for (k = 0, i = 0; v[k] != NULL; k++) {
  5526.           tmp = dnormalize(v[k], symlinks == SYM_IGNORE);
  5527.           dp = &tmp[Strlen(tmp) - 1];
  5528. !         if (is_dirsep(*dp) && dp != tmp)
  5529.   #ifdef apollo
  5530.           if (dp != &tmp[1])
  5531.   #endif /* apollo */
  5532. ***************
  5533. *** 303,309 ****
  5534. --- 303,313 ----
  5535.           xprintf("%S:\n", tmp);
  5536.           for (cp = tmp, dp = buf; *cp; *dp++ = (*cp++ | QUOTE))
  5537.               continue;
  5538. + #if 0
  5539.           if (dp[-1] != (Char) ('/' | QUOTE))
  5540. + #else
  5541. +                 if (! ((dp[-1] & QUOTE) && is_dirsep(dp[-1] & ~QUOTE)))
  5542. + #endif
  5543.               *dp++ = '/';
  5544.           else 
  5545.               dp[-1] &= TRIM;
  5546. ***************
  5547. *** 435,448 ****
  5548.       int     epl, vpl;
  5549.   
  5550.       if ((ep = getenv("EDITOR")) != NULL) {    /* if we have a value */
  5551. !     if ((p = strrchr(ep, '/')) != NULL)     /* if it has a path */
  5552.           ep = p + 1;        /* then we want only the last part */
  5553.       }
  5554.       else 
  5555.       ep = "ed";
  5556.   
  5557.       if ((vp = getenv("VISUAL")) != NULL) {    /* if we have a value */
  5558. !     if ((p = strrchr(vp, '/')) != NULL)     /* and it has a path */
  5559.           vp = p + 1;        /* then we want only the last part */
  5560.       }
  5561.       else 
  5562. --- 439,452 ----
  5563.       int     epl, vpl;
  5564.   
  5565.       if ((ep = getenv("EDITOR")) != NULL) {    /* if we have a value */
  5566. !     if ((p = lastslash(ep)) != NULL)     /* if it has a path */
  5567.           ep = p + 1;        /* then we want only the last part */
  5568.       }
  5569.       else 
  5570.       ep = "ed";
  5571.   
  5572.       if ((vp = getenv("VISUAL")) != NULL) {    /* if we have a value */
  5573. !     if ((p = lastslash(vp)) != NULL)     /* and it has a path */
  5574.           vp = p + 1;        /* then we want only the last part */
  5575.       }
  5576.       else 
  5577. ***************
  5578. *** 462,468 ****
  5579.           continue;
  5580.           *cp = '\0';
  5581.           
  5582. !         if ((cp = strrchr(p, '/')) != NULL)    /* and it has a path */
  5583.           cp = cp + 1;        /* then we want only the last part */
  5584.           else
  5585.           cp = p;            /* else we get all of it */
  5586. --- 466,472 ----
  5587.           continue;
  5588.           *cp = '\0';
  5589.           
  5590. !         if ((cp = lastslash(p)) != NULL)    /* and it has a path */
  5591.           cp = cp + 1;        /* then we want only the last part */
  5592.           else
  5593.           cp = p;            /* else we get all of it */
  5594. ***************
  5595. *** 1405,1417 ****
  5596.       }
  5597.       if (((h = value(STRhome)) != STRNULL) &&
  5598.       (Strncmp(p = *hm, h, j = Strlen(h)) == 0) &&
  5599. !     (p[j] == '/' || p[j] == '\0')) {
  5600.       *hm = &p[j];
  5601.       return STRNULL;
  5602.       }
  5603.       for (i = 0; i < tlength; i++)
  5604.       if ((Strncmp(p = *hm, tcache[i].home, j = tcache[i].hlen) == 0) &&
  5605. !         (p[j] == '/' || p[j] == '\0')) {
  5606.           *hm = &p[j];
  5607.           return tcache[i].user;
  5608.       }
  5609. --- 1409,1421 ----
  5610.       }
  5611.       if (((h = value(STRhome)) != STRNULL) &&
  5612.       (Strncmp(p = *hm, h, j = Strlen(h)) == 0) &&
  5613. !     (is_dirsep(p[j]) || p[j] == '\0')) {
  5614.       *hm = &p[j];
  5615.       return STRNULL;
  5616.       }
  5617.       for (i = 0; i < tlength; i++)
  5618.       if ((Strncmp(p = *hm, tcache[i].home, j = tcache[i].hlen) == 0) &&
  5619. !         (is_dirsep(p[j]) || p[j] == '\0')) {
  5620.           *hm = &p[j];
  5621.           return tcache[i].user;
  5622.       }
  5623. ***************
  5624. *** 1471,1478 ****
  5625. --- 1475,1490 ----
  5626.   
  5627.               if ((n = read(fd, tbuf, BUFSIZE)) <= 0)
  5628.               goto eof;
  5629. + #ifdef DOSTEXT
  5630. +         /* we probably should strip the carriage returns, but
  5631. +          * changing them to blanks will work just as well for most cases
  5632. +          */
  5633. +                     for (i = 0; i < n; i++)
  5634. +                         buf[i] = (tbuf[i] == '\r') ? ' ' : tbuf[i];
  5635. + #else
  5636.               for (i = 0; i < n; i++)
  5637.               buf[i] = tbuf[i];
  5638. + #endif
  5639.               p = buf;
  5640.           }
  5641.           n--;
  5642. ***************
  5643. *** 1666,1671 ****
  5644. --- 1678,1686 ----
  5645.       case '\0':    /* Whoa!! what the hell happened */
  5646.           return -1;
  5647.   
  5648. + #ifdef DOSTEXT
  5649. +     case '\r':
  5650. + #endif
  5651.       case '\n':    /* The end of the line. */
  5652.           if (ws) {    /* terminate the last word */
  5653.           *p = '\0';
  5654. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.os.c ./tc.os.c
  5655. *** ../../store/tcsh-6.03/tc.os.c    Tue Nov 24 13:04:32 1992
  5656. --- ./tc.os.c    Fri Feb 26 03:21:36 1993
  5657. ***************
  5658. *** 1036,1042 ****
  5659.       /* look if we found root yet */
  5660.       if (st_cur.st_ino == st_root.st_ino &&
  5661.           DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) {
  5662. !         (void) strcpy(pathname, *pathptr != '/' ? "/" : pathptr);
  5663.           return (pathname);
  5664.       }
  5665.   
  5666. --- 1036,1042 ----
  5667.       /* look if we found root yet */
  5668.       if (st_cur.st_ino == st_root.st_ino &&
  5669.           DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) {
  5670. !         (void) strcpy(pathname, !is_dirsep(*pathptr) ? "/" : pathptr);
  5671.           return (pathname);
  5672.       }
  5673.   
  5674. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.os.h ./tc.os.h
  5675. *** ../../store/tcsh-6.03/tc.os.h    Tue Nov 24 13:04:32 1992
  5676. --- ./tc.os.h    Fri Feb 26 03:24:24 1993
  5677. ***************
  5678. *** 479,484 ****
  5679. --- 479,485 ----
  5680.   extern int qsort();
  5681.   # endif
  5682.   #else
  5683. + # ifndef __MINT__
  5684.   # ifndef hpux
  5685.   #  if __GNUC__ != 2
  5686.   extern int abort();
  5687. ***************
  5688. *** 490,495 ****
  5689. --- 491,497 ----
  5690.   extern void abort();
  5691.   extern void qsort();
  5692.   # endif
  5693. + # endif /* !__MINT__ */
  5694.   #endif    /* SUNOS4 */
  5695.   extern void perror();
  5696.   
  5697. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.prompt.c ./tc.prompt.c
  5698. *** ../../store/tcsh-6.03/tc.prompt.c    Tue Nov 24 13:04:34 1992
  5699. --- ./tc.prompt.c    Fri Feb 26 03:28:40 1993
  5700. ***************
  5701. *** 303,309 ****
  5702.               else {
  5703.               if ((scp != 'C') && (q = value(STRhome)) != STRNULL &&
  5704.                   Strncmp(buff, q, (k = Strlen(q))) == 0 &&
  5705. !                 (buff[k] == '/' || buff[k] == '\0')) {
  5706.                   buff[--k] = '~';
  5707.                   q = &buff[k];
  5708.                   /* RWM - reset the path length */
  5709. --- 303,309 ----
  5710.               else {
  5711.               if ((scp != 'C') && (q = value(STRhome)) != STRNULL &&
  5712.                   Strncmp(buff, q, (k = Strlen(q))) == 0 &&
  5713. !                 (is_dirsep(buff[k]) || buff[k] == '\0')) {
  5714.                   buff[--k] = '~';
  5715.                   q = &buff[k];
  5716.                   /* RWM - reset the path length */
  5717. ***************
  5718. *** 312,334 ****
  5719.               else {
  5720.                   q = buff;
  5721.                   /* RWM - in case first char is not '/' */
  5722. !                 if (*q == '/') updirs = 0; else updirs = 1;
  5723.               }
  5724.               /* RWM - calculate elements in the path */
  5725.               for (z = q; *z; z++) {
  5726. !                 if (*z == '/') updirs++;
  5727.                   continue;    /* find the end */
  5728.               }
  5729.               /* RWM - the ones we will skip can be found here */
  5730.               updirs -= j;
  5731.               
  5732.               while (j-- > 0) {
  5733. !                 while ((z > q) && (*z != '/'))
  5734.                   z--;    /* back up */
  5735.                   if (j && z > q)
  5736.                   z--;
  5737.               }
  5738. !             if (*z == '/' && z != q)
  5739.                   z++;
  5740.   
  5741.               /* RWM - if *q == '~' and *z != '~' then print */
  5742. --- 312,334 ----
  5743.               else {
  5744.                   q = buff;
  5745.                   /* RWM - in case first char is not '/' */
  5746. !                 if (is_abspath(q)) updirs = 0; else updirs = 1;
  5747.               }
  5748.               /* RWM - calculate elements in the path */
  5749.               for (z = q; *z; z++) {
  5750. !                 if (is_dirsep(*z)) updirs++;
  5751.                   continue;    /* find the end */
  5752.               }
  5753.               /* RWM - the ones we will skip can be found here */
  5754.               updirs -= j;
  5755.               
  5756.               while (j-- > 0) {
  5757. !                 while ((z > q) && (!is_dirsep(*z)))
  5758.                   z--;    /* back up */
  5759.                   if (j && z > q)
  5760.                   z--;
  5761.               }
  5762. !             if (is_dirsep(*z) && z != q)
  5763.                   z++;
  5764.   
  5765.               /* RWM - if *q == '~' and *z != '~' then print */
  5766. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.sig.h ./tc.sig.h
  5767. *** ../../store/tcsh-6.03/tc.sig.h    Tue Nov 24 13:04:34 1992
  5768. --- ./tc.sig.h    Sat Mar 13 21:53:04 1993
  5769. ***************
  5770. *** 62,68 ****
  5771.   /*
  5772.    * sigvec is not the same everywhere
  5773.    */
  5774. ! # if defined(_SEQUENT_) || (defined(_POSIX_SOURCE) && !defined(hpux))
  5775.   #  define HAVE_SIGVEC
  5776.   #  define mysigvec(a, b, c)    sigaction(a, b, c)
  5777.   typedef struct sigaction sigvec_t;
  5778. --- 62,68 ----
  5779.   /*
  5780.    * sigvec is not the same everywhere
  5781.    */
  5782. ! # if defined(_SEQUENT_) || defined(__MINT__) || (defined(_POSIX_SOURCE) && !defined(hpux))
  5783.   #  define HAVE_SIGVEC
  5784.   #  define mysigvec(a, b, c)    sigaction(a, b, c)
  5785.   typedef struct sigaction sigvec_t;
  5786. ***************
  5787. *** 130,139 ****
  5788. --- 130,141 ----
  5789.   /*
  5790.    * For 4.2bsd signals.
  5791.    */
  5792. + # ifndef __MINT__
  5793.   # ifdef sigmask
  5794.   #  undef sigmask
  5795.   # endif /* sigmask */
  5796.   # define    sigmask(s)    (1 << ((s)-1))
  5797. + # endif /* !__MINT__ */
  5798.   # ifdef POSIXSIGS
  5799.   #  define     sigpause(a)    bsd_sigpause(a)
  5800.   #  define     signal(a, b)    bsd_signal(a, b)
  5801. diff --context --new-file --recursive ../../store/tcsh-6.03/tc.vers.c ./tc.vers.c
  5802. *** ../../store/tcsh-6.03/tc.vers.c    Tue Nov 24 13:04:34 1992
  5803. --- ./tc.vers.c    Mon Mar  8 06:04:48 1993
  5804. ***************
  5805. *** 474,479 ****
  5806. --- 474,484 ----
  5807.      hosttype = "vistra800"; /* Stardent Vistra */
  5808.   # endif /* i860  && !_havehosttype_ */
  5809.   
  5810. + # if defined(__MINT__)
  5811. + #  define _havehosttype_
  5812. +     hosttype = "m68k-atari/MiNT";
  5813. + # endif /* __MINT__ */
  5814.   # ifndef _havehosttype_
  5815.   #  if defined(mc68000) || defined(__mc68000__) || defined(mc68k32)
  5816.   #   define _havehosttype_
  5817. diff --context --new-file --recursive ../../store/tcsh-6.03/tw.init.c ./tw.init.c
  5818. *** ../../store/tcsh-6.03/tw.init.c    Tue Nov 24 13:04:26 1992
  5819. --- ./tw.init.c    Mon Mar  8 19:25:18 1993
  5820. ***************
  5821. *** 247,259 ****
  5822.       register Char **pv;
  5823.       struct varent *v = adrof(STRpath);
  5824.       struct varent *recexec = adrof(STRrecognize_only_executables);
  5825.   
  5826.       if (v == NULL) /* if no path */
  5827.       return;
  5828.   
  5829.       for (pv = v->vec; *pv; pv++) {
  5830. !     if (pv[0][0] != '/') {
  5831.           tw_cmd_got |= TW_FL_REL;
  5832.           continue;
  5833.       }
  5834. --- 247,262 ----
  5835.       register Char **pv;
  5836.       struct varent *v = adrof(STRpath);
  5837.       struct varent *recexec = adrof(STRrecognize_only_executables);
  5838. + #ifdef __MINT__
  5839. +     struct varent *suffv = adrof(STRsuffixes);
  5840. +     Char **suffpv;
  5841. + #endif
  5842.   
  5843.       if (v == NULL) /* if no path */
  5844.       return;
  5845.   
  5846.       for (pv = v->vec; *pv; pv++) {
  5847. !     if (!is_abspath(pv[0])) {
  5848.           tw_cmd_got |= TW_FL_REL;
  5849.           continue;
  5850.       }
  5851. ***************
  5852. *** 268,273 ****
  5853. --- 271,289 ----
  5854.           name = str2short(dp->d_name);
  5855.           if (dp->d_ino == 0 || (recexec && !executable(dir, name, 0)))
  5856.           continue;
  5857. + #ifdef __MINT__
  5858. +             {   Char *s = Strrchr(name, '.');
  5859. +                 if (s && suffv) {
  5860. +                     for (suffpv = suffv->vec; *suffpv; suffpv++) {
  5861. +                         if (!Strcmp(s+1, *suffpv)) {
  5862. +                             *s = 0; break;
  5863. +                         }
  5864. +                     }
  5865. +                 }
  5866. +             }
  5867. + #endif /* __MINT__ */
  5868.           tw_cmd_add(name);
  5869.       }
  5870.       (void) closedir(dirp);
  5871. ***************
  5872. *** 421,427 ****
  5873.   
  5874.           CLRDIR(tw_cmd_state.dfd)
  5875.   
  5876. !     while (*tw_cmd_state.pathv && tw_cmd_state.pathv[0][0] == '/')
  5877.           tw_cmd_state.pathv++;
  5878.       if ((ptr = *tw_cmd_state.pathv) != 0) {
  5879.           /*
  5880. --- 437,443 ----
  5881.   
  5882.           CLRDIR(tw_cmd_state.dfd)
  5883.   
  5884. !     while (*tw_cmd_state.pathv && is_abspath(tw_cmd_state.pathv[0]))
  5885.           tw_cmd_state.pathv++;
  5886.       if ((ptr = *tw_cmd_state.pathv) != 0) {
  5887.           /*
  5888. diff --context --new-file --recursive ../../store/tcsh-6.03/tw.parse.c ./tw.parse.c
  5889. *** ../../store/tcsh-6.03/tw.parse.c    Tue Nov 24 13:04:26 1992
  5890. --- ./tw.parse.c    Fri Feb 26 03:50:14 1993
  5891. ***************
  5892. *** 261,267 ****
  5893.       case RECOGNIZE:
  5894.       case RECOGNIZE_ALL:
  5895.       if (adrof(STRautocorrect)) {
  5896. !         if ((slshp = Strrchr(wordp, '/')) != NULL && slshp[1] != '\0') {
  5897.           SearchNoDirErr = 1;
  5898.           for (bptr = wordp; bptr < slshp; bptr++) {
  5899.               /*
  5900. --- 261,267 ----
  5901.       case RECOGNIZE:
  5902.       case RECOGNIZE_ALL:
  5903.       if (adrof(STRautocorrect)) {
  5904. !         if ((slshp = Lastslash(wordp)) != NULL && slshp[1] != '\0') {
  5905.           SearchNoDirErr = 1;
  5906.           for (bptr = wordp; bptr < slshp; bptr++) {
  5907.               /*
  5908. ***************
  5909. *** 350,356 ****
  5910.       items[0] = buffer;
  5911.       items[1] = NULL;
  5912.       ptr = items;
  5913. !     count = (looking == TW_COMMAND && Strchr(wordp, '/') == 0) ? 
  5914.           c_glob(&ptr) : 
  5915.           t_glob(&ptr, looking == TW_COMMAND);
  5916.       if (count > 0) {
  5917. --- 350,356 ----
  5918.       items[0] = buffer;
  5919.       items[1] = NULL;
  5920.       ptr = items;
  5921. !     count = (looking == TW_COMMAND && !Has_slash(wordp)) ? 
  5922.           c_glob(&ptr) : 
  5923.           t_glob(&ptr, looking == TW_COMMAND);
  5924.       if (count > 0) {
  5925. ***************
  5926. *** 1156,1162 ****
  5927.       break;
  5928.   
  5929.       case TW_COMMAND:
  5930. !     if (Strchr(word, '/')) {
  5931.           looking = TW_FILE;
  5932.           flags |= TW_EXEC_CHK;
  5933.           flags |= TW_DIR_OK;
  5934. --- 1156,1162 ----
  5935.       break;
  5936.   
  5937.       case TW_COMMAND:
  5938. !     if (Has_slash(word)) {
  5939.           looking = TW_FILE;
  5940.           flags |= TW_EXEC_CHK;
  5941.           flags |= TW_DIR_OK;
  5942. ***************
  5943. *** 1197,1208 ****
  5944.        */
  5945.       flags |= (gpat == 0) ? TW_IGN_OK : TW_PAT_OK;
  5946.   
  5947. !     if ((*word == '~') && (Strchr(word, '/') == NULL)) {
  5948.       looking = TW_LOGNAME;
  5949.       target = name;
  5950.       }
  5951.       else if ((target = Strrchr(name, '$')) != 0 && 
  5952. !          (Strchr(name, '/') == NULL)) {
  5953.       target++;
  5954.       looking = TW_VARIABLE;
  5955.       }
  5956. --- 1197,1208 ----
  5957.        */
  5958.       flags |= (gpat == 0) ? TW_IGN_OK : TW_PAT_OK;
  5959.   
  5960. !     if ((*word == '~') && (! Has_slash(word))) {
  5961.       looking = TW_LOGNAME;
  5962.       target = name;
  5963.       }
  5964.       else if ((target = Strrchr(name, '$')) != 0 && 
  5965. !          (! Has_slash(name))) {
  5966.       target++;
  5967.       looking = TW_VARIABLE;
  5968.       }
  5969. ***************
  5970. *** 1371,1377 ****
  5971.   {
  5972.       register Char *p;
  5973.   
  5974. !     p = Strrchr(path, '/');
  5975.       if (p == NULL) {
  5976.       copyn(name, path, MAXNAMLEN);
  5977.       dir[0] = '\0';
  5978. --- 1371,1377 ----
  5979.   {
  5980.       register Char *p;
  5981.   
  5982. !     p = Lastslash(path);
  5983.       if (p == NULL) {
  5984.       copyn(name, path, MAXNAMLEN);
  5985.       dir[0] = '\0';
  5986. ***************
  5987. *** 1448,1454 ****
  5988.   
  5989.       switch (old[0]) {
  5990.       case '~':
  5991. !     for (p = new, o = &old[1]; *o && *o != '/'; *p++ = *o++) 
  5992.           continue;
  5993.       *p = '\0';
  5994.       if (gethdir(new)) {
  5995. --- 1448,1454 ----
  5996.   
  5997.       switch (old[0]) {
  5998.       case '~':
  5999. !     for (p = new, o = &old[1]; *o && !is_dirsep(*o); *p++ = *o++) 
  6000.           continue;
  6001.       *p = '\0';
  6002.       if (gethdir(new)) {
  6003. ***************
  6004. *** 1516,1525 ****
  6005.            */
  6006.           for (p = edir; *p; p++)
  6007.           continue;
  6008. !         if (*--p == '/') {
  6009.           for (p = nd; *p; p++)
  6010.               continue;
  6011. !         if (*--p != '/')
  6012.               p = NULL;
  6013.           }
  6014.           for (d = edir, s = nd; (*d++ = *s++) != '\0';)
  6015. --- 1516,1525 ----
  6016.            */
  6017.           for (p = edir; *p; p++)
  6018.           continue;
  6019. !         if (is_dirsep(*--p)) {
  6020.           for (p = nd; *p; p++)
  6021.               continue;
  6022. !         if (!is_dirsep(*--p))
  6023.               p = NULL;
  6024.           }
  6025.           for (d = edir, s = nd; (*d++ = *s++) != '\0';)
  6026. diff --context --new-file --recursive ../../store/tcsh-6.03/tw.spell.c ./tw.spell.c
  6027. *** ../../store/tcsh-6.03/tw.spell.c    Tue Nov 24 13:04:26 1992
  6028. --- ./tw.spell.c    Fri Feb 26 03:54:20 1993
  6029. ***************
  6030. *** 53,60 ****
  6031.       bool    foundslash = 0;
  6032.       int     retval;
  6033.   
  6034.       for (;;) {
  6035. !     while (*old == '/') {    /* skip '/' */
  6036.           *new++ = *old++;
  6037.           foundslash = 1;
  6038.       }
  6039. --- 53,67 ----
  6040.       bool    foundslash = 0;
  6041.       int     retval;
  6042.   
  6043. + #ifdef DOSFS
  6044. +     /* skip drive specification, if any */
  6045. +     if (*old && old[1] == ':' && is_dirsep(old[2])) {
  6046. +         *new++ = *old++; *new++ = *old++;
  6047. +     }
  6048. + #endif
  6049.       for (;;) {
  6050. !     while (is_dirsep(*old)) {    /* skip '/' */
  6051.           *new++ = *old++;
  6052.           foundslash = 1;
  6053.       }
  6054. ***************
  6055. *** 73,79 ****
  6056.           if (p < guess + FILSIZ)
  6057.               *p++ = *cp;
  6058.       ws = p;
  6059. !     for (; *old != '/' && *old != '\0'; old++)/* add current file name */
  6060.           if (p < guess + FILSIZ)
  6061.           *p++ = *old;
  6062.       *p = '\0';        /* terminate it */
  6063. --- 80,86 ----
  6064.           if (p < guess + FILSIZ)
  6065.               *p++ = *cp;
  6066.       ws = p;
  6067. !     for (; !is_dirsep(*old) && *old != '\0'; old++)/* add current file name */
  6068.           if (p < guess + FILSIZ)
  6069.           *p++ = *old;
  6070.       *p = '\0';        /* terminate it */
  6071. ***************
  6072. *** 84,90 ****
  6073.        */
  6074.       /* (*should* say "looking for directory" whenever '/' is next...) */
  6075.       retval = t_search(guess, p, SPELL, FILSIZ,
  6076. !               looking == TW_COMMAND && (foundslash || *old != '/') ?
  6077.                 TW_COMMAND : looking, 1, STRNULL, 0);
  6078.       if (retval >= 4 || retval < 0)
  6079.           return -1;        /* hopeless */
  6080. --- 91,97 ----
  6081.        */
  6082.       /* (*should* say "looking for directory" whenever '/' is next...) */
  6083.       retval = t_search(guess, p, SPELL, FILSIZ,
  6084. !               looking == TW_COMMAND && (foundslash || !is_dirsep(*old)) ?
  6085.                 TW_COMMAND : looking, 1, STRNULL, 0);
  6086.       if (retval >= 4 || retval < 0)
  6087.           return -1;        /* hopeless */
  6088.